Question date parameter

aftershokk

Registered User.
Local time
Today, 19:16
Joined
Sep 5, 2001
Messages
259
I have multiple queries that keep prompting for the same date range. So what I want to do is store start date and end date in a table and then call those dates in each query.

How do I call the table values into a query?

something like Between table date1 And table date2

thanks!:confused:
 
Why not use a form to run the queries, then you enter the dates once into the form and reference the form in the criteria of the queries.

Brian
 
I just tried that also but a pop-up box keeps coming up. The date range is in a where statement in a group by query.


SQL below and date line bolded, it must be a sytnax thing?:

SELECT Sum(dbo_MEDICAL_CLAIM.AMT_CAP_VALUE) AS [CAPPED AMT], dbo_PROVIDER.FIRST_NAME AS [PCP FIRST NAME], dbo_PROVIDER.LAST_NAME AS [PCP LAST NAME]
FROM dbo_MEDICAL_CLAIM INNER JOIN dbo_PROVIDER ON dbo_MEDICAL_CLAIM.PCP_PROV_KEY = dbo_PROVIDER.PROV_KEY

WHERE (((dbo_MEDICAL_CLAIM.SOURCE_KEY)=4) AND ((dbo_MEDICAL_CLAIM.CLAIM_STATUS_CD)="F")
AND ((dbo_MEDICAL_CLAIM.SERVICE_DT)

Between [Forms]![date_form]![date1] And [Forms]![date_form]![date2]))


GROUP BY dbo_PROVIDER.FIRST_NAME, dbo_PROVIDER.LAST_NAME
HAVING (((Sum(dbo_MEDICAL_CLAIM.AMT_CAP_VALUE))>0));
 
That normally means that you have misspelt something, or the form is not open.

Brian
 
I just got it to work. It takes so much longer to run than hardcoding the dates, Anyone ele get this issue when connecting to SQL server 2005 using access?

thx
 

Users who are viewing this thread

Back
Top Bottom