Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select .. between.. 1

Status
Not open for further replies.

miglou

Programmer
May 28, 2002
37
PT
Hello,
i have this
fdt="09-Jul-02"
sdt="10-Jul-02"
strSQL="select name from employee where bd between " & fdt & " and " & sdt

whats the problem here??its because between.... or problems with bad using strings????
T.Y.
 
maybe this?

strSQL=&quot;select name from employee where bd >= &quot; & fdt & &quot; and <= &quot; & sdt
 
Actually, JET needs telling that there are dates that are coming to it and thet it should treat them as dates.

So use

strSQL = &quot;SELECT name FROM employee WHERE bd BETWEEN #&quot; & fdt & &quot;# AND #&quot; & sdt & &quot;#;&quot;


( If you always type SQL key words in CAPS then you'll find it a lot easier to read afterwards. )



QED.

G LS




 
Thanks
LittleSmudge's tip worked...
good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top