Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Date sum?

  1. #1
    Join Date
    Oct 2005
    Posts
    87

    Unanswered: Date sum?

    Hello, i need your help.

    I want to create some sort of services db, where i would enter date when service was made and it could automatically show me the next service date. I know that each service is made once in a three months, so i need somehow to add "3 months" to the current entered date and show result in other field(textbox).

    Then i would like to have some sort of query (i think so) , where i could enter month, and it would show me all services that must be made during that month (that month is = previously entered date + 3 months ).

    Any ideas where i should start from and how do i do that "date sum" to get result in date format.



    Thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    first off I'd look in the help system for date functions.
    then I'd consider which of the various functioins there was most appropriate
    the i'd use that / those functions in any relvant queries / VBA functions
    HTH
    hint the dateadd function could be usefull
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    Check out DateAdd in Help

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Oct 2005
    Posts
    87
    Thnx i'll look for that

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by healdem
    hint the dateadd function could be usefull
    Quote Originally Posted by Poots
    Check out DateAdd in Help
    The old saying about Great Minds holds firm once more
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by pootle flump
    The old saying about Great Minds holds firm once more
    ...and the one that goes on to state "fools never differ"?
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Oct 2005
    Posts
    87
    I did try to use dateadd but i get syntax error...

    If i have one textbox (with date) and i create another textbox (unbound) and write to unobund textbox such control source code:

    "= DateAdd("d", 30, [Textbox1])"


    It gives my stynax error....what could be wrong? this is exactly the same as in help....

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by healdem
    ...and the one that goes on to state "fools never differ"?
    You'll be releived to know that I disagree with almost everything else you post

    YZF - your code is syntactically fine. But - if there is no value in Textbox1 then there is no addition to make. Changing the value of Textbox1 won't cascade down. To prove this, change the formula to:
    Code:
    = DateAdd("d", 30, Date())
    Testimonial:
    pootle flump
    ur codings are working excelent.

  9. #9
    Join Date
    Oct 2005
    Posts
    87
    I did. Still same error "syntax" ...

    you try this code for source control and tell me if it works...for me it doesn't

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    As fresh as can be from Immediate Window:
    Code:
    ?DateAdd("d", 30, Date())
    10/03/2006
    Testimonial:
    pootle flump
    ur codings are working excelent.

  11. #11
    Join Date
    Oct 2005
    Posts
    87
    Quote Originally Posted by pootle flump
    As fresh as can be from Immediate Window:
    Code:
    ?DateAdd("d", 30, Date())
    10/03/2006
    I am writting it in textbox properties (form>design view) under control source .....not in vba.

    And it shows me syntax error when i write such code there: "=DateAdd("d", 30, Date())"

  12. #12
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    well typing
    =DateAdd("d",30,Now())
    as a textbox control's 'control source' works fine at this end
    what version of access are you using?
    what else have you set for this control?

    I'd suggest create a new text box and then paste
    Code:
    =DateAdd("d",30,Now())
    in to control source
    I'd rather be riding on the Tiger 800 or the Norton

  13. #13
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Bloody system not saving posts...

    Quote Originally Posted by YZF
    I am writting it in textbox properties (form>design view) under control source .....not in vba.

    And it shows me syntax error when i write such code there: "=DateAdd("d", 30, Date())"
    They are one and the same. Popping it in to the control source of an unbound textbox elicits the correct results. What are you doing different to the attached?
    Attached Files Attached Files
    Testimonial:
    pootle flump
    ur codings are working excelent.

  14. #14
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    BTW- remember:
    Code:
    DateAdd("d", 30, Date())
    <>
    Code:
    DateAdd("m", 1, Date())
    Testimonial:
    pootle flump
    ur codings are working excelent.

  15. #15
    Join Date
    Oct 2005
    Posts
    87
    At last found out a problem

    Well the difference is that i type =DateAdd("d", 30, Date()) but i should type

    =DateAdd("d"; 30; Date())


    When i copy paste into this forum code, it converts " ; " to " , " ....same for you?


    So now it works OK, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •