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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vb6 and crystal 7 date-time problem

Status
Not open for further replies.

baza

Programmer
May 15, 2001
20
ES
i am writing a report using crystal reports7 in vis basic6 and i keep getting a runtime error 20515
here is the code

Iridium_report.DataFiles(0) = dir_path & "\Iridium.mdb"
Iridium_report.ReportFileName = App.Path & "\Iridium_invoice.rpt"

Iridium_report.WindowTitle = "Tap Files Report"

Iridium_report.SelectionFormula = &quot;{TapFiletable.RECIEVER_PLNM}= '&quot; & txtclientplnm.Text & &quot;'&quot; & &quot; And &quot; & &quot;{TapFileTable.START_DATE} < '&quot; & Format(DTPicker1, &quot;(yyyy, mm, dd)&quot;) & &quot;'&quot;

Iridium_report.SortFields(0) = &quot;+{TapFiletable.EFFECTIVE_DATE}&quot;

Iridium_report.Action = 1

Iridium_report.PageZoom (100)

All the lines of code have been split cos the window is not wide enough but the problem is, I have a field in a table called START_DATE and using a selection formula i am trying to get all data from before the date specified by the datepicker. the error keeps saying that a time-date is expected and i know its because the format of dates in cr7 is different to vb

please help as my boss is kicking my arse about it
 
Note the date format below. this is a parameter being passed to Crystal via a VB frontend. I beleive crystal wants the 00:00:00.000 at the end of the date.

Hope this gives you some ideas.
Ken


AllParams.Add Format(CDate(Trim(txtParameter(x).Text)), &quot;yyyy-mm-dd 00:00:00.000&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top