If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Display record based on current date
I would like to select records that are valid based on todays date. In this case the records startdate and enddate need to be between todays date.
My table has 2 fields stardate and enddate yyyymmdd format as the datatype is long int. An example would be if todays date is 24-05-04 it would return records where 20040524 is between the start and end dates. John H |
#2
|
|||
|
|||
Display record based on current date
criteria in a query would be, roughly,
WHERE StartDate = Date() And EndDate = Date() hth "John H" wrote in message ... I would like to select records that are valid based on todays date. In this case the records startdate and enddate need to be between todays date. My table has 2 fields stardate and enddate yyyymmdd format as the datatype is long int. An example would be if todays date is 24-05-04 it would return records where 20040524 is between the start and end dates. John H |
#3
|
|||
|
|||
Display record based on current date
I think you're going to need:
WHERE StartDate = CLng(Format(Date(), "yyyymmdd")) And EndDate = CLng(Format(Date(), "yyyymmdd")) From the Immediate window: ?CLng(Date()) 38131 ?CLng(Format(Date(), "yyyymmdd")) 20040524 -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "tina" wrote in message ... criteria in a query would be, roughly, WHERE StartDate = Date() And EndDate = Date() hth "John H" wrote in message ... I would like to select records that are valid based on todays date. In this case the records startdate and enddate need to be between todays date. My table has 2 fields stardate and enddate yyyymmdd format as the datatype is long int. An example would be if todays date is 24-05-04 it would return records where 20040524 is between the start and end dates. John H |
Thread Tools | |
Display Modes | |
|
|