If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access Dsum function help
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 |
#2
|
|||
|
|||
Access Dsum function help
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/de...n_20naming.asp "Nate" wrote: 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Advice needed: Should we upgrade MS Access 2000? And if so to what? | ship | General Discussion | 43 | November 30th, 2005 10:58 PM |
Why is a French Spellchecker a "required" update for English speak | French Spellcheck Required? | General Discussion | 23 | April 26th, 2005 01:17 AM |
Hiding Access | Mark A. Sam | Using Forms | 4 | December 1st, 2004 09:09 PM |
is Access 2003 any better than XP? | Gorb | General Discussion | 4 | November 11th, 2004 09:44 PM |
Access 2000 query syntax using DSUM function | [email protected] | Running & Setting Up Queries | 3 | October 15th, 2004 06:27 PM |