rajender123
asked on
SQL query to select the values between dates
Hi guys..
I stucked up with one query i think so simple..
I am writing one application in whcih i have to select the values between dates..
I am writing the query like this.. in VB
sql="select file_name from abc where sdate between '" & text1.text &"' and '" & text2.text & "'"
where i am getting the values in textboxes from calendar..
but this query is showing errors
pls let me know this query how to write the sql to selecct between dates.. it s urgent
I stucked up with one query i think so simple..
I am writing one application in whcih i have to select the values between dates..
I am writing the query like this.. in VB
sql="select file_name from abc where sdate between '" & text1.text &"' and '" & text2.text & "'"
where i am getting the values in textboxes from calendar..
but this query is showing errors
pls let me know this query how to write the sql to selecct between dates.. it s urgent
what database?
ASKER
I am using SQL database and i am using one table which has one date column, namely sdate .
I want the values from one table only
table has the following cols:-
file_name, sdate, client_no,name
I want the values from one table only
table has the following cols:-
file_name, sdate, client_no,name
Hi rajender123,
if you are using SQL Server, just give your dates as yyyy/mm/dd and it will work
Cheers!
if you are using SQL Server, just give your dates as yyyy/mm/dd and it will work
Cheers!
sql="select file_name from abc where sdate >= # " & format(text1.text,"mm/dd/y yyy") &" # and sdate <= # " & format(text1.text,"mm/dd/y yyy") &"#"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.