Access Dsum function help

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

Guest

I have been having trouble breaking this function for my query. I have 2
columns, date and amount. I need to sum the amount for one year for day one.
I then need to add to this total each day going forward, with the amount from
one year forward. I keep getting an error message in each line, not sure if
it is syntax errors.
I will post the function code below:

OneYrOut: DSum("[amount]","[OneYearOut]","[O/N Date]>=#" & [O/N Date] & "#
AND [O/N Date]<#" & DateSerial(Year([O/N Date])+1,Month([O/N Date]),Day([O/N
Date]) & "#"))

Any help is greatly appreciated- thanks
 
Your problem is cause by bad naming conventions and lack of object
qualification.
The best rule for naming is - Use only Letters, Digits, and the underscore _
Spaces and special characters are problematic.
It looks like you have a field in your table name [O/N Date] and a control
on your form with the same name. (This is a gem, it violates every naming
convention. Spaces, special characters, and using a reserved word - Date)

You are confusing Jet with ambiguity. Qualify your ojbects:
Table field -> MyTableName.[O/N Date]
Form control -> Forms!MyFormName![O/N Date]

I suggest you visit this site:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccess/html/msdn_20naming.asp
 

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

Similar Threads

Excel Help with dates 2
value displayed repeatedly 9
DSum function 4
Returning zero in a query? 3
DSum - running total 2
DSum 3
dsum sytax error 5
Parameter Query with DSum 1

Back
Top