Fromdate todate syntax error

  • Thread starter Thread starter Kevin W via AccessMonster.com
  • Start date Start date
K

Kevin W via AccessMonster.com

I have the following in my query on reportdate field, but I'm getting a
syntax error.

Between Forms![frmReportPanel]![FromDate] AND Forms![frmReportPanel]![ToDate]

Can anyone tell me the correct syntax?

Thanks,
Kevin W.
 
1. Declare parameters.
In query design view, choose Parameters on the Query menu.
In the dialog, enter two rows:
Forms![frmReportPanel]![FromDate] Date/Time
Forms![frmReportPanel]![ToDate] Date/Time

2. Presumably your expression is in the Criteria row in query design, under
some field? What field is this? If it is a Date/Time field from a table,
that should work. If it is a calculated field, try wrapping the calculation
in CVDate(). For example, if you currently have:
DateDue: [InvoiceDate] + 14
change it to:
DateDue: CVDate([InvoiceDate] + 14)
 
Hi Allen,
Please help.... I'm getting a syntax error on the bracketing.

Allen said:
1. Declare parameters.
In query design view, choose Parameters on the Query menu.
In the dialog, enter two rows:
Forms![frmReportPanel]![FromDate] Date/Time
Forms![frmReportPanel]![ToDate] Date/Time

2. Presumably your expression is in the Criteria row in query design, under
some field? What field is this? If it is a Date/Time field from a table,
that should work. If it is a calculated field, try wrapping the calculation
in CVDate(). For example, if you currently have:
DateDue: [InvoiceDate] + 14
change it to:
DateDue: CVDate([InvoiceDate] + 14)
I have the following in my query on reportdate field, but I'm getting a
syntax error.
[quoted text clipped - 3 lines]
Can anyone tell me the correct syntax?
 
OK, can you copy and post the SQL of your query?

(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message

This might give us a hint.

Kevin W via AccessMonster.com said:
Hi Allen,
Please help.... I'm getting a syntax error on the bracketing.

Allen said:
1. Declare parameters.
In query design view, choose Parameters on the Query menu.
In the dialog, enter two rows:
Forms![frmReportPanel]![FromDate] Date/Time
Forms![frmReportPanel]![ToDate] Date/Time

2. Presumably your expression is in the Criteria row in query design, under
some field? What field is this? If it is a Date/Time field from a table,
that should work. If it is a calculated field, try wrapping the calculation
in CVDate(). For example, if you currently have:
DateDue: [InvoiceDate] + 14
change it to:
DateDue: CVDate([InvoiceDate] + 14)
I have the following in my query on reportdate field, but I'm getting a
syntax error.
[quoted text clipped - 3 lines]
Can anyone tell me the correct syntax?
 
Here's my SQL :

SELECT DISTINCTROW qryResolution.TrackingNo, qryResolution.CompanyName,
qryResolution.CustomerNo, qryResolution.TempName, qryResolution.JobOrder,
qryResolution.[WE-Date], qryResolution.AssignedDate, qryResolution.AssignedTo,
qryResolution.Reportedby, qryResolution.ReportedDate, qryResolution.WorkFlow,
qryResolution.Status, qryResolution.[Issue-ActionNotes], tblParm.FromDate,
tblParm.ToDate, tblParm.AssignTo, qryResolution.IssueType
FROM qryResolution, tblParm
WHERE (((qryResolution.JobOrder) Is Not Null) AND ((qryResolution.
AssignedDate) Between [FromDate] And [ToDate]) AND ((qryResolution.AssignedTo)
=[Forms]![frmReportPanel]![AssignTo]));

When I pull up the report the "assignedDate" does match the report panel form
.. When I change the date on the reportpanel, the report dates (fromdate and
todate) does not change.

From the report panel, what I want to do is have the User pick from and to
dates, assignedto and/or companyname and get a report for this criteria. If
they do not chose any parameters, then the report should show everything.

Thanks,
Kevin W.
OK, can you copy and post the SQL of your query?

(Possibly unneeded instructions follow)
Open the query
Select View:Sql from the Menu
Select all the text
Copy it
Paste it into the message

This might give us a hint.
Hi Allen,
Please help.... I'm getting a syntax error on the bracketing.
[quoted text clipped - 18 lines]
 
Okay. I got the data on the report to match the parameters on the report
panel, But the "fromdate" and "todate" fields at the top of my report do not
match the parameters on the report panel. I'm using the fromdate" and
"todate" fields at the top of my report to let the User know he has the
currect date range.

How do I get the fromdate" and "todate" fields at the top of my report to
match the parameters picked on the report panel form??

Thanks,
Kevin
Here's my SQL :

SELECT DISTINCTROW qryResolution.TrackingNo, qryResolution.CompanyName,
qryResolution.CustomerNo, qryResolution.TempName, qryResolution.JobOrder,
qryResolution.[WE-Date], qryResolution.AssignedDate, qryResolution.AssignedTo,
qryResolution.Reportedby, qryResolution.ReportedDate, qryResolution.WorkFlow,
qryResolution.Status, qryResolution.[Issue-ActionNotes], tblParm.FromDate,
tblParm.ToDate, tblParm.AssignTo, qryResolution.IssueType
FROM qryResolution, tblParm
WHERE (((qryResolution.JobOrder) Is Not Null) AND ((qryResolution.
AssignedDate) Between [FromDate] And [ToDate]) AND ((qryResolution.AssignedTo)
=[Forms]![frmReportPanel]![AssignTo]));

When I pull up the report the "assignedDate" does match the report panel form
. When I change the date on the reportpanel, the report dates (fromdate and
todate) does not change.

From the report panel, what I want to do is have the User pick from and to
dates, assignedto and/or companyname and get a report for this criteria. If
they do not chose any parameters, then the report should show everything.

Thanks,
Kevin W.
OK, can you copy and post the SQL of your query?
[quoted text clipped - 12 lines]
 
Back
Top