Results 1 to 4 of 4

Thread: Problem in SelectionFormula

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    4

    Problem in SelectionFormula

    Hi,

    I am doing a project in VB and MS Access. I have designed one crystal report which fethc data from one table. Now I want to select the records only between some dates (this date is one field in the table). In the VB code i wrote code like this

    cryst.selectionformula = "{tablename.date} >= '1/1/2003' and {tablename.date} <= '10/10/2003' "

    but it is not coming, giving error message like "Error in formula".
    Is my selectionformula is correct or not, can we compare dates by enclosing between single quotes('). Please any one can help me.

    Thanks in advance.

    sunil.

  2. #2
    Banned
    Join Date
    Jul 2003
    Location
    New delhi
    Posts
    143
    hi

    to use date date type u have to use date type function.

    or u can use format type to manipulate your date
    biswajit das

  3. #3
    Lively Member
    Join Date
    Sep 2003
    Posts
    74
    You have break the dates in pieces and then do this

    DD1 = DatePart("d", DTPicker1)
    MM1 = DatePart("m", DTPicker1)
    YY1 = DatePart("yyyy", DTPicker1)
    DD2 = DatePart("d", DTPicker2)
    MM2 = DatePart("m", DTPicker2)
    YY2 = DatePart("yyyy", DTPicker2)


    strSQL = "{@deliveryDate} >= Date(" & YY1 & "," & MM1 & "," & DD1 & ") " & " AND {@deliveryDate} <= Date(" & YY2 & "," & MM2 & "," & DD2 & ")"

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Posts
    4
    I got it......

    thank u very much


    sunil

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