LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a recordset defined by primarykeys using the LabVIEW Database Connectivity Toolset?

Hi folks.
I'm using LabVIEW with the LabVIEW Db Toolset and Microsoft Access. The table contains 18 columns with a growing nr of rows.Now I want to get the whole recordset containing all columns defined by my primary keys. My SQL-statement is sofar:
SELECT ALL FROM IMPULS_STATOR WHERE FAB = [string] AND LDATE = [datestring] AND ADATE = [datestring]
But every time I end up with an error message saying "Invalid string: specified field does not exist or contains an unsupported character". I mutated the statement several times, adding or removing spaces, colons, etc.
What am I doing wrong?
Thanks in advance
0 Kudos
Message 1 of 3
(2,827 Views)
It's been awhile since I've had to use an Access database but I seem to remember some issues with how compliant Access was with SQL date format. I found an old query that used the syntax SELECT * FROM table WHERE serial_number = '1234' and Start_Date = DateValue(2001-12-03'). Note the ' mark that surrounds a string and the use of DateValue when the column type is defined as DateTime. Good luck.
0 Kudos
Message 2 of 3
(2,827 Views)
Thanks, Dennis.
Unfortunately, I`m still encountering some problems with the DateValue function. My date/time field has this format: yyyy-mm-dd hh:nn:ss . If I use DateValue, nothing will be returned. Changing the format to yyyy-mm-dd in the Access DB didn`t help and I do need the time. Combining DateValue and TimeValue let to several errors. Using only TimeValue did not help me out. LabVIEW does not indicate errors anymore, therefore the syntax should be fine. But I don`t get any information back from my database.
0 Kudos
Message 3 of 3
(2,827 Views)