J
Jen
I have a query that currently runs using built in date parameters. I want to
change this to run from a form, but every time I try to run the query this
way it comes back with incorrect results (28 entries instead of about 3000 -
it only uses the last txt box instead of acting as a 'between' statement). I
have done this on many of the queries & reports that I have already built, so
I understand how it should work. I've checked the data type of the field in
the table, query & form. I've used the parameters area within the query to
define the txt boxes as parameters. Nothing seems to fix the problem. The
main table is not a sql table - I don't know what language it is based from
but it uses a Simba Client ODBC driver to bring in the info... does anyone
know of a way to set this so that they dates don't need to be hard-coded each
time? Here is the SQL behind the query.
PARAMETERS [forms]![frmDatesforTotalView]![txtStart] DateTime,
[forms]![frmdatesforTotalView]![txtEnd] DateTime;
SELECT schedheader.MODIFY_DATE_TIME, schedheader.AGENT_ID, schedheader.DATE,
schedheader.SCHED_ID, schedheader.EXCEPTION_CODE,
tblExeptionCodes.EXC_PRINT_NAME, schedheader.START_MINUTE,
schedheader.SCHEDULE_LENGTH INTO tblThisWeeksScheduleHeader
IN 'N:\ADMIN\Jennifer SM\Total View\TotalViewTest.mdb'
FROM tblExeptionCodes INNER JOIN schedheader ON tblExeptionCodes.EXC_ID =
schedheader.EXCEPTION_CODE
WHERE (((schedheader.DATE) Between [forms]![frmDatesforTotalView]![txtStart]
And [forms]![frmDatesforTotalView]![txtEnd]) AND
((schedheader.EXCEPTION_CODE)<>32))
ORDER BY schedheader.AGENT_ID, schedheader.DATE;
Thank you!
change this to run from a form, but every time I try to run the query this
way it comes back with incorrect results (28 entries instead of about 3000 -
it only uses the last txt box instead of acting as a 'between' statement). I
have done this on many of the queries & reports that I have already built, so
I understand how it should work. I've checked the data type of the field in
the table, query & form. I've used the parameters area within the query to
define the txt boxes as parameters. Nothing seems to fix the problem. The
main table is not a sql table - I don't know what language it is based from
but it uses a Simba Client ODBC driver to bring in the info... does anyone
know of a way to set this so that they dates don't need to be hard-coded each
time? Here is the SQL behind the query.
PARAMETERS [forms]![frmDatesforTotalView]![txtStart] DateTime,
[forms]![frmdatesforTotalView]![txtEnd] DateTime;
SELECT schedheader.MODIFY_DATE_TIME, schedheader.AGENT_ID, schedheader.DATE,
schedheader.SCHED_ID, schedheader.EXCEPTION_CODE,
tblExeptionCodes.EXC_PRINT_NAME, schedheader.START_MINUTE,
schedheader.SCHEDULE_LENGTH INTO tblThisWeeksScheduleHeader
IN 'N:\ADMIN\Jennifer SM\Total View\TotalViewTest.mdb'
FROM tblExeptionCodes INNER JOIN schedheader ON tblExeptionCodes.EXC_ID =
schedheader.EXCEPTION_CODE
WHERE (((schedheader.DATE) Between [forms]![frmDatesforTotalView]![txtStart]
And [forms]![frmDatesforTotalView]![txtEnd]) AND
((schedheader.EXCEPTION_CODE)<>32))
ORDER BY schedheader.AGENT_ID, schedheader.DATE;
Thank you!