Between..And query

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

Guest

I need to have a query that finds a range of numbers within a range of dates.
When I enter between [start date] and [end date] for the date field and
between $50 and $250 for the amount field it says it's too complex. How can
I accomplish this?
 
Post the SQL and we'll take a look under the hood. My query based on
your description works fine.

SELECT dateField,
currencyField,
id
FROM Table4
WHERE (dateField BETWEEN #2/1/2007# AND #3/1/2007#)
AND (currencyField BETWEEN 50 AND 250);

To see the SQL go to Query Designer and select "View"->"SQL View"

Cheers,
Jason Lepack
 
SELECT Pledges.Paid, [Contributors].[DonorFirstName] & " " & [DonorLastName]
AS DonorName, Month([PaymentDate]) AS [Month], Day([PaymentDate]) AS [Day],
Year([PaymentDate]) AS [Year], Pledges.AmountPledged,
Contributors.WorkAddress, Contributors.WorkCity, Contributors.WorkState,
Contributors.WorkZip
FROM Contributors INNER JOIN Pledges ON Contributors.ContributorID =
Pledges.ContributorID
WHERE (((Pledges.Paid) Between [Start Date] And [End Date]) AND
((Contributors.PAC)=-1)) OR (((Pledges.AmountPledged)>"$50.01"<250));


Jason Lepack said:
Post the SQL and we'll take a look under the hood. My query based on
your description works fine.

SELECT dateField,
currencyField,
id
FROM Table4
WHERE (dateField BETWEEN #2/1/2007# AND #3/1/2007#)
AND (currencyField BETWEEN 50 AND 250);

To see the SQL go to Query Designer and select "View"->"SQL View"

Cheers,
Jason Lepack


I need to have a query that finds a range of numbers within a range of dates.
When I enter between [start date] and [end date] for the date field and
between $50 and $250 for the amount field it says it's too complex. How can
I accomplish this?
 
Try this ---
WHERE (Pledges.Paid Between [Start Date] And [End Date] AND
Pledges.AmountPledged) Between 50.01 AND 250) OR Contributors.PAC=-1;

--
KARL DEWEY
Build a little - Test a little


OEB said:
SELECT Pledges.Paid, [Contributors].[DonorFirstName] & " " & [DonorLastName]
AS DonorName, Month([PaymentDate]) AS [Month], Day([PaymentDate]) AS [Day],
Year([PaymentDate]) AS [Year], Pledges.AmountPledged,
Contributors.WorkAddress, Contributors.WorkCity, Contributors.WorkState,
Contributors.WorkZip
FROM Contributors INNER JOIN Pledges ON Contributors.ContributorID =
Pledges.ContributorID
WHERE (((Pledges.Paid) Between [Start Date] And [End Date]) AND
((Contributors.PAC)=-1)) OR (((Pledges.AmountPledged)>"$50.01"<250));


Jason Lepack said:
Post the SQL and we'll take a look under the hood. My query based on
your description works fine.

SELECT dateField,
currencyField,
id
FROM Table4
WHERE (dateField BETWEEN #2/1/2007# AND #3/1/2007#)
AND (currencyField BETWEEN 50 AND 250);

To see the SQL go to Query Designer and select "View"->"SQL View"

Cheers,
Jason Lepack


I need to have a query that finds a range of numbers within a range of dates.
When I enter between [start date] and [end date] for the date field and
between $50 and $250 for the amount field it says it's too complex. How can
I accomplish this?
 
Thanks. Here is the query.

SELECT Pledges.Paid, [Contributors].[DonorFirstName] & " " & [DonorLastName]
AS DonorName, Date([PaymentDate]), Pledges.AmountPledged,
Contributors.WorkAddress, Contributors.WorkCity, Contributors.WorkState,
Contributors.WorkZip, Contributors.PAC
FROM Contributors INNER JOIN Pledges ON Contributors.ContributorID =
Pledges.ContributorID
WHERE (((Pledges.Paid) Between [Start Date] And [End Date]) AND
((Contributors.PAC)=-1)) OR (((([Pledges].[AmountPledged])>"$50.01")<250));

As you see there are several more fields I am searching on. I know the
range of numbers, but the date range will change. Thanks.1
Jason Lepack said:
Post the SQL and we'll take a look under the hood. My query based on
your description works fine.

SELECT dateField,
currencyField,
id
FROM Table4
WHERE (dateField BETWEEN #2/1/2007# AND #3/1/2007#)
AND (currencyField BETWEEN 50 AND 250);

To see the SQL go to Query Designer and select "View"->"SQL View"

Cheers,
Jason Lepack


I need to have a query that finds a range of numbers within a range of dates.
When I enter between [start date] and [end date] for the date field and
between $50 and $250 for the amount field it says it's too complex. How can
I accomplish this?
 
Back
Top