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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB and seq

Status
Not open for further replies.

Gregsy35

Programmer
Dec 5, 2000
21
CA
i am tryin to run a query thru vb
the query will find all dates in a database between 2 dates selected on a control. When i tried this thou i select dates in which i no date exists for in the database but it comes up 0 every time

can anyone please please help!??
cheers gregs
 
1. What kind of database you're using? (MS Access, SQL Server, Oracle...)
2. How's your query syntax?
 
Keep in mind that each query with dates, regardless of the date format you have in your computer needs to have the format mm/dd/yyyy. So it is always a good idea to use the function format(dt,"mm/dd/yyyy") for the dates.
 

I've used format(dt, "yyyymmdd") when inserting records. That way the field is naturally sorted. You still need to use a "Order By" clause on your SQL, but there's much less work involved for the database server.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top