SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Oct 2002
    Location
    Alameda, CA
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to modify a date?

    I want to add 1 to the Day part of a DATETIME object. Is there a way to do this?

    I've tried the following:
    which gets:
    *** Error: Incompatible types -- '10/52/2002 16:06:28 PM' is not a valid date
    Which gets
    "*** Error: Incompatible types -- '10/31/2002 16:16:9 PM' is not a valid date"

    I've bolded the parts that I think might make the date invalid.

    How can I Add 1 to the date?

    Why is there no SetDatePart?

    PS: <CTRL+mouse wheel down> will make the code much more readable.
    ------------------
    -Josh

    [This message has been edited by VolleyJosh (edited 10-30-2002).]

    [This message has been edited by VolleyJosh (edited 10-30-2002).]
    -Josh

  2. #2
    Member
    Join Date
    Oct 2002
    Location
    Alameda, CA
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to modify a date?

    Annnndd the answer is:

    Although I don't know what will happen on the 31st, since this is a hack. <edit - "*** Error: Incompatible types -- '2002-10-32 16.34.08.000000' is not a valid date" as I expected>
    Surely there is a way to do it with the DATETIME object itself?

    ------------------
    -Josh

    [This message has been edited by VolleyJosh (edited 10-30-2002).]

    [This message has been edited by VolleyJosh (edited 10-30-2002).]
    -Josh

  3. #3
    Senior Member
    Join Date
    Aug 1999
    Location
    MA
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to modify a date?

    Look up AddDateTime in the help. This will avoid any hacks crossing month boundaries, year boundaries, etc... Segue already figured that stuff out with AddDateTime...

    result:
    ------------------
    Steven Tyler
    SQA Automation Team Manager
    Workforce Central Group
    Kronos Incorporated
    E-Mail: styler@kronos.com www.kronos.com
    Improving the Performance of People and Business™

    [This message has been edited by styler (edited 10-30-2002).]

    [This message has been edited by styler (edited 10-30-2002).]
    Steven Tyler
    Manager - Performance Engineering

    Kronos Incorporated
    tel: +1 978 947 4219

  4. #4
    Member
    Join Date
    Oct 2002
    Location
    Alameda, CA
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to modify a date?

    Awesome. I just figured it out with
    TransformDate as well.

    Thanks for the help. AddDateTime is what I needed.

    ------------------
    -Josh
    -Josh

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:45 PM.

Copyright BetaSoft Inc.