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
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