Results 1 to 3 of 3

Thread: How to pass the date(string) value from vb6 to crystal reports 9?

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2005
    Posts
    57

    How to pass the date(string) value from vb6 to crystal reports 9?

    Friends,

    I tried this formula but the result is not correct.

    VB Code:
    1. fdval = dpfrom.Value
    2. tdval = dpto.Value
    3.  
    4. With Report
    5.     .RecordSelectionFormula = "(cdate({admin.cfdate}) >= #" & fdval & "# and cdate({admin.ctdate}) <= #" & tdval & "#) " _
    6.     & "and ({admin.cpp} = 'CSOP')"
    7. End With

    The problem is the "admin.cdate" is a text datatype in ms-access.
    if i put cdate({admin.cdate}) then its taking mm/dd/yyyy format.
    if i format the fdval as mm/dd/yyyy then im getting a wrong result.
    but the admin.cdate is always stored as dd/mm/yyyy (but as a text datatype)
    In this case, how can i pass the parameter to get the exact result.
    I dont have any data between 1-apr-2006 to 7-may-2006.
    But im getting one record in my result.
    which is 04/03/2006 inside the ms-access.

    Please treat this as urgent.

    Thanks & Regards
    Sathyguy

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: How to pass the date(string) value from vb6 to crystal reports 9?

    Use

    VB Code:
    1. .RecordSelectionFormula = "(cdate({admin.cfdate}) Between " & Date(Year(fdval) & "," & month(fdval) & "," & day(fdval) & ") and Date("  & & "(Year(tdval) & "," & month(tdval) & "," & day(tdval) & ") and " ({admin.cpp} = 'CSOP')"
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2005
    Posts
    57

    Re: How to pass the date(string) value from vb6 to crystal reports 9?

    could you please recheck your code? and post

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