Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange error report calling from asp.net....please

Status
Not open for further replies.

msdotnet

Programmer
Jun 13, 2002
4
US
hi guys,

Iam so strange about this syntax problem in asp.net calling crystal report from aspx page

dim strdate as datetime
strdate = selectdate

rpt1.selectionformula = "{table1.personid}=" & personid & "and {table1.mydate}='" & strdate.Tostring("yyyy.M.d.hh.mm.ss") & "'"

in the above code its showing an error like

error in formula and date-time is required..

Please help me to getout from this error...
thanks
 
I'm not sure that this is a .NET problem but this doesn't look right to me

dim strdate as datetime
strdate = selectdate

rpt1.selectionformula = "{table1.personid}=" & personid & "and {table1.mydate}='" & strdate.Tostring("yyyy.M.d.hh.mm.ss") & "'"


in Table1...is the field "mydate" a date or a string?? From the sounds of your error it is a datetime field

Well you have just dim'd StrDate as DateTime and assigned it a value SelectDate which presumably is DateTime so there is no reason for a string conversion at all....also if there is I don't think ... strdate.Tostring("yyyy.M.d.hh.mm.ss")....is valid in Crystal or Basic syntax...(although I confess to not seeing Crystal.net if you are using that)

If StrDate is a datetime value then I think the formula should be

dim strdate as datetime
strdate = selectdate

rpt1.selectionformula = "{table1.personid}=" & personid & "and {table1.mydate}=" & strdate

I don't launch from VB much so my syntax may be wrong though. Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top