Hello, i am getting a problem to generate a report based on a date. iam using vb.net 2005 and SQL 2000. here is my code;
[code=vbnet]
myConnection = New SqlConnection(" Data Source=CALVIN20 09\DEV;Initial Catalog=TBFMS;I ntegrated Security=True;d atabase = TBFMS")
MyCommand.Conne ction = myConnection
'If Main.ManifestDa tagrid.Selected Rows.Count > 0 Then
MyCommand.Comma ndText = "select *from Booking2 where BookingDate between convert(datetim e,'" & Format(Me.DateT imePicker1.Valu e, "dd/MM/yyyy") & "',103) AND ""convert(datet ime,'" & Format(Me.DateT imePicker1.Valu e.AddDays(1), "dd/MM/yyyy") & "',103"
MyCommand.Comma ndType = CommandType.Tex t
myDA.SelectComm and = MyCommand
myDA.Fill(myDS, "Booking2")
[/code]
it gives an error: "Unclosed quotation mark before the character string 'convert(dateti me....and so on..
please help
[code=vbnet]
myConnection = New SqlConnection(" Data Source=CALVIN20 09\DEV;Initial Catalog=TBFMS;I ntegrated Security=True;d atabase = TBFMS")
MyCommand.Conne ction = myConnection
'If Main.ManifestDa tagrid.Selected Rows.Count > 0 Then
MyCommand.Comma ndText = "select *from Booking2 where BookingDate between convert(datetim e,'" & Format(Me.DateT imePicker1.Valu e, "dd/MM/yyyy") & "',103) AND ""convert(datet ime,'" & Format(Me.DateT imePicker1.Valu e.AddDays(1), "dd/MM/yyyy") & "',103"
MyCommand.Comma ndType = CommandType.Tex t
myDA.SelectComm and = MyCommand
myDA.Fill(myDS, "Booking2")
[/code]
it gives an error: "Unclosed quotation mark before the character string 'convert(dateti me....and so on..
please help
Comment