Access2000_JS1
Registered User.
- Local time
- Yesterday, 22:07
- Joined
- Dec 10, 2005
- Messages
- 24
The following statement returns NULL
Dim str As String
Dim n As Variant
str = "RemitDate >= #" & Forms![Report Menu].FromDate & "# AND RemitDate <= #" & Forms![Report Menu].ToDate & "#"
n = DSum("GSTPaid", "queryJobRemittance", str)
yet however when I run the query ie
SELECT sum(GSTPaid) FROM queryjobremittance
WHERE remitdate>=[Forms]![report menu].[fromDate] And remitdate<=[forms]![report menu].[todate];
it works fine.
The remitdate is short date,the format is dd/mm/yy, and the dsum works fine when no criteria.
Any advice will be much appreciated. Thanks.
Dim str As String
Dim n As Variant
str = "RemitDate >= #" & Forms![Report Menu].FromDate & "# AND RemitDate <= #" & Forms![Report Menu].ToDate & "#"
n = DSum("GSTPaid", "queryJobRemittance", str)
yet however when I run the query ie
SELECT sum(GSTPaid) FROM queryjobremittance
WHERE remitdate>=[Forms]![report menu].[fromDate] And remitdate<=[forms]![report menu].[todate];
it works fine.
The remitdate is short date,the format is dd/mm/yy, and the dsum works fine when no criteria.
Any advice will be much appreciated. Thanks.