date Field

G

Guest

I have a date field in a query pulling from our ERP system. I've used a
between statement in the past to get the data I need. I now have a need to
calculate last months start date and end date. I'm trying use the following
between statement but it doesn't work.
Between (DateSerial(Year(Date()),Month(Date())-1,1) And
(DateSerial(Year(Date()), Month(Date()),0)

Date Field format is yyyy,mm,dd. Do I need to format the field before I can
use this between statement?
 
R

Rick Brandt

mccloud said:
I have a date field in a query pulling from our ERP system. I've used a
between statement in the past to get the data I need. I now have a need to
calculate last months start date and end date. I'm trying use the following
between statement but it doesn't work.
Between (DateSerial(Year(Date()),Month(Date())-1,1) And
(DateSerial(Year(Date()), Month(Date()),0)

Date Field format is yyyy,mm,dd. Do I need to format the field before I can
use this between statement?

No. Formattting only affects the display. The actual stored data is always the
same.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top