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

SQL Query 1

Status
Not open for further replies.

Askeladden

Programmer
Jan 28, 2004
87
NO
I am trying, by using SQL in my VB 6.0 program, in combination with Access, to read a field 'Forfall', which has a datatype of DATETIME. In my program I need to list all dates (but, just the date!) that are equal to the systemdate (of host machine) and excludes the field 'Kvitter ut' = 0.

The SQL code i have so far is:

Code:
SELECT Forfall, Ansvarlig, Eiendom, Bygg, Anlegg, [Ordre Beskrivelse], Merknader, [Interval Nummer], [Interval Gang], [Kvitter ut], ID
FROM [Vedlikeholds Rutiner]
WHERE [Kvitter ut] = 0
ORDER BY Forfall ASC

This works, but only by listing entries that does have a '0' in the 'Kvitter ut' field. I need to code it so that it also limits the entries listing to those that have todays date (i.e. the host computers systemdate), or above.
This code I am not sure of since I am not very familiar with SQL.
Can someone please help in this?
Thanks! :)

Christian
 
Have you tried this ?
WHERE [Kvitter ut] = 0 And Forfall=Date()
Or, if Forfall has time values too:
WHERE [Kvitter ut] = 0 And Int(Forfall)=Int(Date())

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top