Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 writing sql query for datareports

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-25 : 11:45:52
george writes "I am using vb6.0 and msaccess as backend ,
and vb's default dataReports

if user want to get a report frm one date to other date
how could i manage to do ..
pls tell me how to pass date's dynamically from a vb-form
to reports..
pls give me help on writing the sql query.."

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-04-28 : 20:28:59
There are a few different approaches to this, I suspect what you want is something like...

Dim sql as string
sql = "select * from table "
sql = sql & "where mydate between "
sql = sql & "#" & Format("dd mmm yyyy",datDate1) & "# and "
sql = sql & "#" & Formate("dd mmm yyyy",datDate2) & "#"

I've used Format("dd mmm yyyy", etc to avoid all confusion with different date formats...

But there are other ways too...

HTH


--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -