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

This date time literal was not understood 1

Status
Not open for further replies.

ts04

Technical User
Jun 14, 2004
69
NL
Using: VB 6, Crystal Reports 9, Btrieve database

I have a RecordSelectionFormula like this:

Dim begin_dat As String * 8
Dim eing_dat As String * 8
Dim StrSelectionFormula As String

Private Sub Cmd_Start_Algemeen_Click()

begin_dat = Format$(Datum_Van.Value, "yyyymmdd")
eind_dat = Format$(Datum_Tot.Value, "yyyymmdd")

CRDetails.DiscardSavedData
StrSelectionFormula = "{GEPRS.Dat} in #" & begin_dat & "# to #" & eind_dat & "#"

CRDetails.RecordSelectionFormula = StrSelectionFormula
Form3.Show

End Sub

Datum_van and Datum_tot are voth MonthViews

The GEPRS.Dat field in my database is of the type string (lenght 8) and the data looks like this:
20040713

When I run the program and press the action button that triggers the procedure above the following run-time '-2147191851 (800473d5)' error occurs: "This date time literal was not understood"

How can I make this work??

Tanja
 
{GEPRS.Dat} is not being stored as a date but a string so loose the '#' and use single quotes instead.

StrSelectionFormula = "{GEPRS.Dat} BETWEEN '" & begin_dat & "' to '" & eind_dat & "'"


"Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top