Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
djbomb95
Starting Member
9 Posts |
Posted - 2012-09-08 : 03:23:18
|
Ok, I have a perfectly fine SQL query, and it does exactly what I want it to do. This is it below.SELECT Sum(Price) AS TotalPriceFROM PizzaOrderWHERE PizzaOrder.PizzaID In (SELECT PizzaID FROM PizzaOrder WHERE OrderID = 89);My issue arises when I come accross to vba, trying to get the value that this query would return into a textbox. The way I've translated it goes as follows:txtPrice = DSum("Price", "PizzaOrder", "PizzaID IN " & DLookup("PizzaID", "PizzaOrder", "OrderID = " & txtOrderID & "") & "")txtPrice is the name of the textbox. I've used a dsum() to replace the Sum() in sql, and my main need is to find an alternative to the "Where... In (Subquery)" syntax. Dlookup only returns the first value, but I am sure I will require more than one value to be returned. Any help would be greaty appreciated. Thanks. |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
|
|
|
|