Results 1 to 4 of 4
  1. #1
    Yoni is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    2

    Update Query works in Access 2007 but not in 2010

    I have an interesting issue. I wrote a simple update query that uses a dsum formula and it worked fine in access 2007. my computer was recently upgraded to access 2010 and the query no longer does the right calculations. There are no errors, just blank cells and false results.



    The query only calls one table, named PreSum. It updates one field in PreSum called Paid Cumuler.

    Here is the code:

    UPDATE PreSum SET PreSum.[Paid Cumuler] = DSum("[Paid]","PreSum","[ClaimNb] = " & [ClaimNb] & "AND [Treaty] = '" & [Treaty] & "' AND [Section] = '" & [Section] & "' AND [Line of Business] = '" & [Line of Business] & "' AND [Invoice Date] <= # " & [Invoice Date] & "#");

    All fields are in the table PreSum
    As I said, there are no errors and it works in access 2007.

    Thanks

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    The first place I would look is [Invoice Date]. Is it presenting the data in the order MS Access is expecting it to in this case, which is mm/dd/yy? If the day is <= 12, the the data would be valid to MS Access. Try using Format([Invoice Date],"mm/dd/yyyy") in between the # signs.

    John

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Perhaps John is correct, but I think you also need to correct the syntax in this area

    "AND [Treaty]...
    You will need a space between the " and AND

    Just my $.02

  4. #4
    Yoni is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2012
    Posts
    2

    Thanks

    Quote Originally Posted by John_G View Post
    Hi -

    The first place I would look is [Invoice Date]. Is it presenting the data in the order MS Access is expecting it to in this case, which is mm/dd/yy? If the day is <= 12, the the data would be valid to MS Access. Try using Format([Invoice Date],"mm/dd/yyyy") in between the # signs.

    John
    Thanks John, That worked. I suspected it was something with the dates as well, but couldnt figure it out.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Update Query how it works
    By waqas in forum Queries
    Replies: 10
    Last Post: 09-10-2011, 11:04 AM
  2. Update Query Works Once
    By Lorlai in forum Access
    Replies: 2
    Last Post: 07-22-2011, 08:31 AM
  3. Access 2002 to 2007 or 2010
    By DSTR3 in forum Access
    Replies: 2
    Last Post: 11-13-2010, 03:52 PM
  4. Running update query in access 2010
    By dbansal in forum Queries
    Replies: 1
    Last Post: 09-03-2010, 10:57 AM
  5. MS Access 2007 vs 2010
    By ralphjramirez in forum Access
    Replies: 2
    Last Post: 05-06-2010, 06:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums