Problems manipulating recordsource

T

Tessa

HI!

I have a SQL Pass-Through Querie in ACCESS that looks like this:

SELECT TOP 100 PERCENT COUNT(*) AS antall, dbo.Status.StatusName,
T.StatusId
FROM
(SELECT dbo.Notes.*
FROM dbo.Notes
WHERE (NoteDate BETWEEN CONVERT(DATETIME, '2003-11-11
00:00:00', 102) AND CONVERT(DATETIME, '2004-01-01 00:00:00', 102)))
T INNER JOIN
dbo.Status ON T.StatusId = dbo.Status.StatusId
GROUP BY dbo.Status.StatusName, T.StatusId
ORDER BY antall DESC

I am using this as a recordsource in a report.

I am further using a form to let the user change the betweendates
himself. For doing this I need to change the recordsource with the new
dates. This is not as easy as it seems..

If I am just using this query again in Me.Recordsource in the report I
am getting error on the CONVERT method -So I changed it to this
format:
MakeUSDate = "#" & Month(X) & "/" & Day(X) & "/" & Year(X) & "#"

Now access is asking for input parameters for antall (COUNT(*) AS
antall).
I have no clue at all anymore..

Can anyone help me?

Regards,
Tessa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top