Create query

  • Thread starter Thread starter Derick
  • Start date Start date
D

Derick

I use a query builder. The query is created from a form.
The problem is that the date format is not the same in
data file as in the creteria. The setting is set to
machine format. But when the query is created it
automatically select another format resuling in incorrect
data.

How do I correct the problem?

Thanks

Derick
 
Derick said:
I use a query builder. The query is created from a form.
The problem is that the date format is not the same in
data file as in the creteria. The setting is set to
machine format. But when the query is created it
automatically select another format resuling in incorrect
data.

How do I correct the problem?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Access (JET) db:

Dates are stored as floating-point numbers. You can use PARAMETERS in
queries to indicate the data type of a parameter. E.g.:

PARAMETERS Forms!FormName!ControlName Date;
SELECT ... etc.
FROM ...
WHERE DateColumn = Forms!FormName!ControlName

This will pick up the date value from a control on the named form and,
if it is a valid date, convert it into the floating-point
representation of the date.

If you wish to hard-code the date value in the query you have to use
USA date format (mm/dd/yy) and the # delimiters. E.g.:

SELECT ... etc.
FROM ...
WHERE DateColumn = #9/25/04#

This date is 25 Sep 2004.

HTH,

MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQFoV5oechKqOuFEgEQI+GQCguwL29FbUJiIyytsUP1JaFKX3/N8AniGM
DaBQidifKFzAMKDkbjLpSBb1
=bqD1
-----END PGP SIGNATURE-----
--
 
Back
Top