LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Select records in Database using SQL query between 2 dates

Hello,

 

I have some datas saved onto an SQL database. I want to select only the records between two different dates (datetime type for the column). The records include day and hour. I want to select datas between two days.

Do you know what is the syntax of the SQL query?

Thanks a lot!


Gael

0 Kudos
Message 1 of 4
(3,676 Views)

@ganquetil wrote:

Hello,

 

I have some datas saved onto an SQL database. I want to select only the records between two different dates (datetime type for the column). The records include day and hour. I want to select datas between two days.

Do you know what is the syntax of the SQL query?

Thanks a lot!


Gael


I guess you didn't bother to try Google first.

0 Kudos
Message 2 of 4
(3,664 Views)

Hello,

 Follow this link.

Sivaraj M.S
CLA
0 Kudos
Message 3 of 4
(3,659 Views)

Though this has nothing to do with LabVIEW, your query will look like the following:

 

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date between '2011/02/25' and '2011/02/27'

or can use

select Date, TotalAllowance from Calculation where EmployeeId = 1
             and Date >= '2011/02/25' and Date <= '2011/02/27'

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 4
(3,637 Views)