Results 1 to 8 of 8

Thread: DateTime

  1. #1

    Thread Starter
    Addicted Member waelr's Avatar
    Join Date
    Nov 2004
    Posts
    168

    DateTime

    Greetings
    I'm trying to generate a report that returns records by comparing DateTime
    I'm using selection formula: {TransactionByAmount.mesg_crea_date_time} >= DateTime('" & Dt1 & "') and {TransactionByAmount.mesg_crea_date_time} <= DateTime('" & Dt2 & "') "
    Dt1 and Dt2 are 2 variables
    Comparing the date works fine but comparing time is incorrect
    any help appreciated
    thank u

  2. #2
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: DateTime

    use "#" intead of "'" to compare date
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Arrow Re: DateTime

    Quote Originally Posted by waelr
    Greetings
    I
    Comparing the date works fine but comparing time is incorrect
    any help appreciated
    thank u
    Just watch the crystal report tutorial at my signature on the post 2 ,
    post 2 is related to the date example

    where i give the example that how to find the value between two date

    hope it will help ful for you

    Link at my signature

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: DateTime

    Quote Originally Posted by shukla
    use "#" intead of "'" to compare date
    Hi shukla
    This wiil not work in the crystal report if you are not using the selection formula for comparing the date see the link at my signature related to the crystal report ,post2


  5. #5
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: DateTime

    hello shakti
    i think by using between clause and "#" statement it will definately going to be work.
    VB Code:
    1. {TransactionByAmount.mesg_crea_date_time} between #" & Dt1 & "# and #" & Dt2 & "# "
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  6. #6
    Fanatic Member
    Join Date
    Jul 2006
    Location
    nasik,india
    Posts
    909

    Re: DateTime

    by the way.
    HAPPY DIWALI
    ALL OF YOU.
    WHETHER YOU SUCCEED OR FAIL IS NOT AS IMPORTANT AS WHETHER YOU TRIED YOUR BEST

  7. #7
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Talking Re: DateTime

    Quote Originally Posted by shukla
    by the way.
    HAPPY DIWALI
    ALL OF YOU.
    HAPPY DIWALI

  8. #8
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Thumbs up Re: DateTime

    Quote Originally Posted by shukla
    hello shakti
    i think by using between clause and "#" statement it will definately going to be work.
    VB Code:
    1. {TransactionByAmount.mesg_crea_date_time} between #" & Dt1 & "# and #" & Dt2 & "# "
    Hi shukla
    I test this code but some time in the crystal report search this wil not give the batter result
    so in the selection formula i change the code
    you check this code at my signature at the post 2 in the crystal report tutorial


    Happy Deepawali to you

Posting Permissions

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



Click Here to Expand Forum to Full Width