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

Search dates in access

Status
Not open for further replies.

HiZiNg

Technical User
Mar 4, 2003
4
NO
Hi!

Im setting up a access database and I am wondering... how do i search after dates...I mean, in my access file i have salespersons, the number of sales they have in a month and the dates they sold them... the thing is that I want to search for is how many sales and what kind of sales have salesperson X sold in a period, and if i have a name what has this person sold on witch date.
Or does anyone know about any good access sites

Hope this was understanding


Aksel
 
Here are some bits of code that may help you. You can get frustrated until you realise that dates in queries should be US dates:

Public Function MakeUSDate(X As Variant)

If Not IsDate(X) Then Exit Function
MakeUSDate = "#" & Month(X) & "/" & Day(X) & "/" & Year(X) & "#"

End Function

Here is a part of a line (the WHERE clause) from a query that searches for dates within a span 6 days.

WHERE ShiftDate >= &quot; & MakeUSDate(TargetDate) & &quot; AND ShiftDate < &quot; & MakeUSDate(TargetDate + 6)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top