Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Query statement in Excel
I was trying to find a record in the Access database from my excel sheet. I manage to connect to the database successfully and come out with the query string. but when i run the code I can't find the record from the database, in fact the record is in. In the database, the data type for each field a Field Datatype Counter Text Date Date/Time Volume Number Unit Price Number Below is my code: ----------------------------------------------------------- Set db = OpenDatabase("D:\Profiles\csl096c\My Documents\Personal\OwnFiles\db1.mdb") Let strQueryString = "SELECT * FROM Sell " & _ "WHERE Counter LIKE '" & strCounter & _ "' AND Date LIKE '" & strDate & _ "' AND Volume = " & Val(strVolume) & _ " AND [Unit Price] = " & Val(strUnitPrice) Set rstSell = dbKlse.OpenRecordset(strQueryString) ----------------------------------------------------------- can somebody please point out to me what possible i did wrong or i didn't do. Please help. Many Thanks in advance.. Thanks, SB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Writing an IF statement in Microsoft Query | Excel Worksheet Functions | |||
IF Statement Query | Excel Worksheet Functions | |||
If statement query | Excel Worksheet Functions | |||
IF statement query | Excel Discussion (Misc queries) | |||
IF statement query | Excel Worksheet Functions |