Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date field Parameter using ADO

Status
Not open for further replies.

munchen

Technical User
Aug 24, 2004
306
GB
I am using version 8.5 and connecting via ADO to a Microsoft Access database.

Normally when i connect via ODBC I have created a parameter based on a date field and have the following code in the report selection formula:

{tblLieu.LieuDate} in {?Date} to {?Date}

However when connecting via ADO to a database the above code does not produce the correct data. For example I have the following three records:

EmployeeID 1
Lieu Date 25/11/04

EmployeeID 1
Lieu Date 26/11/04

EmployeeID 1
Lieu Date 27/11/04

If i enter 01/11/04 and 11/11/04 then all three are displayed, however if i enter any date higher than 11/11/04 (eg 12/11/04,13/11/04 etc)then none of the records are displayed.

Is this a common date conversion issue? Is it seeing the date as another format (not dd/mm/yy)?

Hope someone can help.

 
Do you have a typo in your record selection formula above? I don't see why any records would appear given the formula above and your parameter selections.

-LB
 
My apologies lbass yes there was a typo. It should read:

{tblLieuTime.LieuDate} in {?StartDate} to {?EndDate}
 
The same also applies if I try to do a greater than or equal to just one date parameter.

{tblLieuTime.LieuDate} >= {?StartDate}

As i mentioned earlier with it only showing up to 11/11/04 i assume the problem must be linked into the date format (ie its seeing the date format differently from a dd/mm/yy format).
 
This code in the report selection formula (no parameter)works and brings back the three records as expected.

{tblLieuTime.LieuDate}
in
DateTime (2004, 11, 20, 00, 00, 00)
to
DateTime (2004, 11, 29, 00, 00, 00)

I want the parameter field ({?StartDate} to prompt the user for a date rather than a date time. Am i entering the incorrect format?

The parameter {?StartDate} prompts the user for a date in the following format dd/mm/yyyy
The report selection formula is currently:
{tblLieuTime.LieuDate} >= {?StartDate}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top