LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time interval

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

0 Kudos
Message 1 of 3
(2,352 Views)

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

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 3
(2,340 Views)

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.

0 Kudos
Message 3 of 3
(2,326 Views)