Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2003
    Posts
    54

    Question Unanswered: calculating dates

    Hi,
    I need to calculate dates for my report instead of using begin date and end date parameters. How do I do that in basic or crystal syntax?? I wanted my begin date to be same day of today but the year should be 4 years less than the present year and the end date should be two weeks from today. Please help!!!! I have been using date() function and the datediff andf dateadd functions from visual basic but the check function always finds some problem with my formula.

    Regards

    Jaideep

  2. #2
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    23
    //Try this one as a record formular
    {YourTable.YourDateColumn} In CDate(Year(CurrentDate) - 4, Month(CurrentDate), Day(CurrentDate)) To CurrentDate- 14

  3. #3
    Join Date
    Apr 2003
    Posts
    54

    Thumbs up

    hi,
    Thanks for your reply. Does Cdate and dateserial work the same way??? I did it using dateserial. I am a newbie and a DBA. Don't have any idea about VB.

    Regards

    Jaideep

  4. #4
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    23

    Wink

    Hi Jaideep,

    don't know about dateserial, I'm also no VBA programmer, I'm always using the Crystal syntax, never ever VBA. Maybe it's because I'm working with cr since version 3 and in the firts attempts the VBA Syntax had some troubles.

    CDate is Cystal syntax, takes three numbers, year, month, and day.

    Have a nice weekend

    Sneaky Pie

Posting Permissions

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