Help wih formula

P

Patricia

I want to pick between certain dates, say by quarter.
So should my formuate be:

Between [1/1/07] and [3/30/07]

I'm not sure how to use dates in expressions.

-Thanx
 
K

KARL DEWEY

The criteria would be ----
Between #1/1/07# And #3/30/07#

Or you can enter in one date and have it calculate ---
Between [Enter begining date] And DateAdd("q",1, [Enter begining date])-1
 
S

SteveM

In the criteria row: Between 1/1/07 And 3/30/07

Access should put in octothorpes for you but if you want to type it correctly:
Between #1/1/07# And #3/30/07#

If you use square brackets in the criteria row that do not contain field
names you are creating placeholders for values obtained from the user at
runtime. For example: Between [Enter start date] And [Enter end date]
When the query is run, the user is asked for each value...try it!

Steve
 
D

Douglas J. Steele

Date constants need to be delimited with #

Between #1/1/07# and #3/30/07#

(They also need to be in a format that Access will recognize. mm/dd/yy
should work, but mm/dd/yyyy would be better)
 
S

SteveM

Doug,
dd/mm/yy works fine in queries if locale is appropriate e.g. UK.

Using dates in form/report filters etc. usually has to be formatted to
mm/dd/yy though...

Steve

Douglas J. Steele said:
Date constants need to be delimited with #

Between #1/1/07# and #3/30/07#

(They also need to be in a format that Access will recognize. mm/dd/yy
should work, but mm/dd/yyyy would be better)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Patricia said:
I want to pick between certain dates, say by quarter.
So should my formuate be:

Between [1/1/07] and [3/30/07]

I'm not sure how to use dates in expressions.

-Thanx
 
D

Douglas J. Steele

Sorry, but that's not my experience, nor that of others. There are very few
places where Access will respect regional settings.

Take a look at what Allen Browne has in "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I had in my September 2003 Access
Answers column for Pinnacle Publication's "Smart Access" newsletter. (The
column and accompanying database can be downloaded for free at
http://www.accessmvp.com/djsteele/SmartAccess.html)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


SteveM said:
Doug,
dd/mm/yy works fine in queries if locale is appropriate e.g. UK.

Using dates in form/report filters etc. usually has to be formatted to
mm/dd/yy though...

Steve

Douglas J. Steele said:
Date constants need to be delimited with #

Between #1/1/07# and #3/30/07#

(They also need to be in a format that Access will recognize. mm/dd/yy
should work, but mm/dd/yyyy would be better)

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Patricia said:
I want to pick between certain dates, say by quarter.
So should my formuate be:

Between [1/1/07] and [3/30/07]

I'm not sure how to use dates in expressions.

-Thanx
 
Top