this query below can run properly but when i adjusting the query i got
an error, the error said Unclosed quotation mark after the character string ''.
Original Query (can run without error)
Dim da As New SqlDataAdapter("SELECT MaklumatPelajar.Nama,MaklumatPelajar.NoIc,KesalahanDisiplin.KategoriKes,KesalahanDisiplin.SubKes,KesalahanDisiplin.TarikhKes,KesalahanDisiplin.AduanOleh,MaklumatPelajar.Kelas" & _
" FROM MaklumatPelajar INNER JOIN KesalahanDisiplin ON MaklumatPelajar.IdPelajar = KesalahanDisiplin.IdPelajar" & _
" WHERE KesalahanDisiplin.KategoriKes = '" & getSessionKategori & "' AND KesalahanDisiplin.SubKes = '" & getSessionSubKategori & "'", mySQLConnection)
Modified Query
Dim da As New SqlDataAdapter("SELECT MaklumatPelajar.Nama,MaklumatPelajar.NoIc,KesalahanDisiplin.KategoriKes,KesalahanDisiplin.SubKes,KesalahanDisiplin.TarikhKes,KesalahanDisiplin.AduanOleh,MaklumatPelajar.Kelas" & _
" FROM MaklumatPelajar INNER JOIN KesalahanDisiplin ON MaklumatPelajar.IdPelajar = KesalahanDisiplin.IdPelajar" & _
" WHERE KesalahanDisiplin.KategoriKes = '" & getSessionKategori & "' AND KesalahanDisiplin.SubKes = '" & getSessionSubKategori & "' AND kesalahandisiplin.TarikhKes between convert(datetime, '" + getStartDate + "',103) AND convert(datetime,'" + getEndDate + "',103)" & "'", mySQLConnection)
afastars
Member
52 Points
221 Posts
SQL Query Error Unclosed quotation mark after the character string
Dec 11, 2012 12:34 PM|LINK
this query below can run properly but when i adjusting the query i got
an error, the error said Unclosed quotation mark after the character string ''.
Original Query (can run without error) Dim da As New SqlDataAdapter("SELECT MaklumatPelajar.Nama,MaklumatPelajar.NoIc,KesalahanDisiplin.KategoriKes,KesalahanDisiplin.SubKes,KesalahanDisiplin.TarikhKes,KesalahanDisiplin.AduanOleh,MaklumatPelajar.Kelas" & _ " FROM MaklumatPelajar INNER JOIN KesalahanDisiplin ON MaklumatPelajar.IdPelajar = KesalahanDisiplin.IdPelajar" & _ " WHERE KesalahanDisiplin.KategoriKes = '" & getSessionKategori & "' AND KesalahanDisiplin.SubKes = '" & getSessionSubKategori & "'", mySQLConnection)Modified Query
Dim da As New SqlDataAdapter("SELECT MaklumatPelajar.Nama,MaklumatPelajar.NoIc,KesalahanDisiplin.KategoriKes,KesalahanDisiplin.SubKes,KesalahanDisiplin.TarikhKes,KesalahanDisiplin.AduanOleh,MaklumatPelajar.Kelas" & _ " FROM MaklumatPelajar INNER JOIN KesalahanDisiplin ON MaklumatPelajar.IdPelajar = KesalahanDisiplin.IdPelajar" & _ " WHERE KesalahanDisiplin.KategoriKes = '" & getSessionKategori & "' AND KesalahanDisiplin.SubKes = '" & getSessionSubKategori & "' AND kesalahandisiplin.TarikhKes between convert(datetime, '" + getStartDate + "',103) AND convert(datetime,'" + getEndDate + "',103)" & "'", mySQLConnection)oned_gk
All-Star
30991 Points
6344 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 11, 2012 12:44 PM|LINK
afastars
Member
52 Points
221 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 11, 2012 01:00 PM|LINK
hi oned_gk
i got it, but it appear date and time , need to display date only
i use this query on my crystal report, any idea regading this...?
nilsan
All-Star
16826 Points
3684 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 11, 2012 01:28 PM|LINK
If you're going to use above query for multiple purpose, then leave it as it is and format it in your frontend.
For SQL Server :
http://www.sql-server-helper.com/tips/date-formats.aspx
For Crystal Report, check here
oned_gk
All-Star
30991 Points
6344 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 11, 2012 11:33 PM|LINK
Select the field in the report and reigh click -> format embeded field
afastars
Member
52 Points
221 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 12, 2012 12:04 AM|LINK
there are no embeded option that i can saw......i'm using crtstal report built in in visual studio 2008
oned_gk
All-Star
30991 Points
6344 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 12, 2012 12:19 AM|LINK
Use format editor set hour=none, minute=none,second=none
afastars
Member
52 Points
221 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 12, 2012 12:26 AM|LINK
can you tell me a bit details..because i can't catch up..i;m new in this concept
oned_gk
All-Star
30991 Points
6344 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 12, 2012 12:34 AM|LINK
close your "Error Unclosed quotation mark" threat and ask your question in new threat
afastars
Member
52 Points
221 Posts
Re: SQL Query Error Unclosed quotation mark after the character string
Dec 12, 2012 12:37 AM|LINK
orait..already open a new thread..but still no reply so far....