|
-
Nov 15th, 2003, 06:01 AM
#1
Thread Starter
New Member
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.
-
Nov 17th, 2003, 12:56 AM
#2
Banned
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
-
Nov 17th, 2003, 02:11 PM
#3
Lively Member
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 & ")"
-
Nov 19th, 2003, 05:45 AM
#4
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|