Date format

S

Scott

I have a DCount function on report footer as below:-

DCount("*","TableName", "[DateField] between #MM/DD/YY# and #MM/DD/YY#")

It works correctly but the date format must be American way MM/DD/YY,
European way. Other dates in use are all European way. Why does DCount use
American way? Is it possible to change to European way?

I use the same method with a query but it produced #Error

DCount("*","QueryName", "[DateField] between #MM/DD/YY# and #MM/DD/YY#")

The query is a parameter query requiring to enter start date and end date.
Can I use parameter input to replace the fixed criteria in DCount function.

Thanks,

Scott
 
D

Douglas J. Steele

The date format is fixed: remember that Access was developed in the US.
However, that shouldn't be an issue: you can always use the Format function
to format the dates correctly.

Take a look at Allen Browne's "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I have 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)
 
S

Scott

Douglas,

Many thanks for your useful information on date input.

Regarding the second part of question, can Dcount be used on a parameter
query? If so, how to get the values from the parameter query inputs for
DCount processing.

Scott

Douglas J. Steele said:
The date format is fixed: remember that Access was developed in the US.
However, that shouldn't be an issue: you can always use the Format
function to format the dates correctly.

Take a look at Allen Browne's "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I have 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 private e-mails, please)


Scott said:
I have a DCount function on report footer as below:-

DCount("*","TableName", "[DateField] between #MM/DD/YY# and #MM/DD/YY#")

It works correctly but the date format must be American way MM/DD/YY,
European way. Other dates in use are all European way. Why does DCount
use American way? Is it possible to change to European way?

I use the same method with a query but it produced #Error

DCount("*","QueryName", "[DateField] between #MM/DD/YY# and #MM/DD/YY#")

The query is a parameter query requiring to enter start date and end
date. Can I use parameter input to replace the fixed criteria in DCount
function.

Thanks,

Scott
 
D

Douglas J. Steele

I'm not sure I understand your second question.

Are you asking if it's possible to put parameters into a DCount statement,
and have popup input boxes appear to prompt you for those parameters? If so,
the answer is no.

Since you're running the DCount statement in VBA, you need to use VBA to
prompt for the values (or else you can reference controls on a form)

If that's not what you're asking, perhaps you can restate your question,
with an example if possible.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Scott said:
Douglas,

Many thanks for your useful information on date input.

Regarding the second part of question, can Dcount be used on a parameter
query? If so, how to get the values from the parameter query inputs for
DCount processing.

Scott

Douglas J. Steele said:
The date format is fixed: remember that Access was developed in the US.
However, that shouldn't be an issue: you can always use the Format
function to format the dates correctly.

Take a look at Allen Browne's "International Dates in Access" at
http://allenbrowne.com/ser-36.html or what I have 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 private e-mails, please)


Scott said:
I have a DCount function on report footer as below:-

DCount("*","TableName", "[DateField] between #MM/DD/YY# and #MM/DD/YY#")

It works correctly but the date format must be American way MM/DD/YY,
European way. Other dates in use are all European way. Why does DCount
use American way? Is it possible to change to European way?

I use the same method with a query but it produced #Error

DCount("*","QueryName", "[DateField] between #MM/DD/YY# and #MM/DD/YY#")

The query is a parameter query requiring to enter start date and end
date. Can I use parameter input to replace the fixed criteria in DCount
function.

Thanks,

Scott
 

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