criteria on calculated field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I hope someone can help me, because I've been staring at the computer too
long. I have a field [DateDue] in a query that calculates 30 days from
another field in that query. That works fine. However, when I run the
query, I only want it to pull records where [DateDue] is between [startdate]
and [enddate]. The last 2 are dates that the user enters everytime the query
is run. For some reason, when I've done this, it pulls all records, not just
the ones between the 2 entered parameters. Can anyone help me fix this?
Thanks!
 
Can you post the SQL you have?

Does your query look like

Select * From TableName Where DateAdd("d",30,[DateFieldName]) Between
[Please Enter start date] And [Please enter end date]
 
SELECT DateAdd("d",30,[Company Received]) AS [Date Due]
(DateAdd("d",30,[Company Received])) Between [startdate] And [enddate])
CJB


Ofer said:
Can you post the SQL you have?

Does your query look like

Select * From TableName Where DateAdd("d",30,[DateFieldName]) Between
[Please Enter start date] And [Please enter end date]

--
\\// Live Long and Prosper \\//
BS"D


CJB said:
I hope someone can help me, because I've been staring at the computer too
long. I have a field [DateDue] in a query that calculates 30 days from
another field in that query. That works fine. However, when I run the
query, I only want it to pull records where [DateDue] is between [startdate]
and [enddate]. The last 2 are dates that the user enters everytime the query
is run. For some reason, when I've done this, it pulls all records, not just
the ones between the 2 entered parameters. Can anyone help me fix this?
Thanks!
 
This SQL doesn't make any sense, where the WHERE and The FROM

Yours
SELECT DateAdd("d",30,[Company Received]) AS [Date Due]
(DateAdd("d",30,[Company Received])) Between [startdate] And [enddate])

Shuld be
SELECT DateAdd("d",30,[Company Received]) AS [Date Due] FROM TableName
WHERE DateAdd("d",30,[Company Received]) Between [startdate] And [enddate]

--
\\// Live Long and Prosper \\//
BS"D


CJB said:
SELECT DateAdd("d",30,[Company Received]) AS [Date Due]
(DateAdd("d",30,[Company Received])) Between [startdate] And [enddate])
CJB


Ofer said:
Can you post the SQL you have?

Does your query look like

Select * From TableName Where DateAdd("d",30,[DateFieldName]) Between
[Please Enter start date] And [Please enter end date]

--
\\// Live Long and Prosper \\//
BS"D


CJB said:
I hope someone can help me, because I've been staring at the computer too
long. I have a field [DateDue] in a query that calculates 30 days from
another field in that query. That works fine. However, when I run the
query, I only want it to pull records where [DateDue] is between [startdate]
and [enddate]. The last 2 are dates that the user enters everytime the query
is run. For some reason, when I've done this, it pulls all records, not just
the ones between the 2 entered parameters. Can anyone help me fix this?
Thanks!
 
Back
Top