A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access Dsum function help



 
 
Thread Tools Display Modes
  #1  
Old July 12th, 2006, 06:39 PM posted to microsoft.public.access.queries
Nate
external usenet poster
 
Posts: 181
Default 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  
Old July 12th, 2006, 07:00 PM posted to microsoft.public.access.queries
Klatuu
external usenet poster
 
Posts: 7,074
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 01:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.