Hi friends,
I am unable to fetch out correct result on date base. I am writing following code for fetching all records of a table between two dates.

db.execute"select * from travel where doj between '"& doj.text &"' AND '"& doj1.text &"';"

but above query can't give record between specified date.

Thanking you

hi. try this.

db.execute"select * from travel where doj between #" & doj.text &"# AND #" &  doj1.text 
& "# 

db.execute"select * from travel where doj between cdate('" & doj.text  & "') AND cdate('" & doj.text  & "')
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.