07-21-2011 12:27 AM
Hi everyone,
I am facing a problem in fetching data from my database which is my Microsoft Access database. I'm fetching data from my table by the column including date format "DD/MM/YYYY". As the data from the table is not in correct sequence, it is hard for me to fetch the data properly. My data sometimes jump from "1/1/2011" to "10/1/2011". And I found out that the SQL "Between" command arranges the number by the first digit, second digit and third digit which is kind of "1,10,100,11,12,13,14,15,16,2,20,21". I just want to fetch my data from a time interval of "DD/MM/YYYY" to "DD/MM/YYYY". So can anyone pls help me out??
Thanks a million.
Raymond
07-21-2011 02:10 AM
Hi,
There are two ways to solve this issue, either you can solve this in LabVIEW itself or by doing some modification in your query you can solve this at your database level.
In LabVIEW you can use sort array function with respect to your Time/Date column. Now from this sorted data you can easily find out the data between particular Data/Time.
In SQL level you can use some function like order by, cast and convert to get the data is desired format.
Thanks and Regards
Himanshu Goyal
07-21-2011 09:51 AM
It seems that the column has not been defined as date/time and instead is a text field. Your 'BETWEEN' is returning in ASCII order which would be expected with a text datatype.