Date for this month

  • Thread starter Thread starter SAC
  • Start date Start date
S

SAC

I get data from a mainframe. The date is in this format:

20051003.

How can I build a where clause in a sql statement to only return the records
for this month, using the system time.

Would I use datepart(). Just not sure on how to handle it when it's in this
format.

Should I change it using dateserial?

Any help would be appreciated.

Thanks.
 
I started using datepart and for year it returns 279.

This is what I did:
varYear = Datepart("y",Now())

How can I get it to return 2005?

Thanks.
 
varYear = Datepart("yyyy",Now())

SAC said:
I started using datepart and for year it returns 279.

This is what I did:
varYear = Datepart("y",Now())

How can I get it to return 2005?

Thanks.
 
SAC said:
I get data from a mainframe. The date is in this format:

20051003.

How can I build a where clause in a sql statement to only return the records
for this month, using the system time.


Try using the criteria:

Like Format(Date(), "yyyymm\*")
 
Back
Top