LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in retrieving record from database

Hello friends,

                      I have a database (mdb / SQL) in which I am writing date/time and 4 other columns, During retrieving record I expect only date from user and retrieve records using select query, I am able to retrieve the record by giving date / time but when I am providing only date then there is no record coming out.

 

Thanks.

 

 

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 6
(2,871 Views)

What is the SQL query that you are using?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(2,863 Views)

For reading one record 

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

select * from Scaned_Report where col1 = #11:20:45 27-07-2013#

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

For reading multiple records

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

select * from Scaned_Report where col1 between #27-07-2013 09:30:20# and #27-07-2013 10:00:00# 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Done in mdb database. I want to retrive by mentioning only date.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 6
(2,859 Views)

In Jet there is no real clean way of selecting all the records for a specific day. The best solution seems to be to use the "between" clause and for the time portions specify "00:00:00" and "23:59:59", respectively.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 6
(2,853 Views)

I already did that.I chose the time from 6AM to 6PM. becasue this is better as per my requirement.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 6
(2,797 Views)

Your database screenshot shows a date format different from those used in queries you posted.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 6
(2,781 Views)