|
Subject:
|
RecordSelectionformula for crystalrpt in asp.net
|
|
Posted By:
|
Active
|
Post Date:
|
8/8/2004 1:31:53 AM
|
Hi,
I am creating a record selection formula in asp.net to select the records and display in crystal reports. When i give the range for a date field in database,It gives error: "Datetime string is expected" In database filed is in datetime format..
I have tried few of format methods also.no use..can anyone pls help me out ? urgent !! Below is my code:
dim recselect as string Dim datefrom As DateTime = get_DateFrom.Text Dim dateupto As DateTime = get_DateUpto.Text
RecSelect = RecSelect & "{Sales.Sale_Date} >= " & datefrom & " " & _ "and {Sales.Sale_Date} <= " & dateupto & ""
rpt.recordselectionformula = recselect
note : sales.sale_date is the value from database get_datefrom is textbox in frontend
I have already tried with system.convert.todatetime also but in vain...
Can u direct me with syntax.. hope someone would have faced with same probs!!! I heard the way is to separate month,year and day and then join as date and then use it for comparision..if someone have used this method kindly help..
-Active
|
|
Reply By:
|
ryanus
|
Reply Date:
|
9/29/2004 10:03:04 AM
|
try this
strRecordSelection = " {employee.task_date} >= #9-23-2004#";
Ryan
|
|