PDA

View Full Version : Solved: date error in vb.6 help



shamsam1
11-22-2008, 12:39 AM
Dim s5 As String, s6 As String, s7 As String, s8 As String
s5 = Text1.text

s6 = Format(s5, "dd/MM/yyyy")
format(Text1.text,yyyy)
s8 = Format(Text1.text, "yyyy-mm-dd")
s7 = Year(s6)
If (s7 Mod 4) <> 0 Then
sql = "SELECT DateAdd(d, 365, 'S8') As NewDate"
Set rs = Con.Execute(sql)
While Not rs.EOF
If rs.BOF = False Then
MsgBox ((NEWDATE))
End If
rs.MoveNext
Wend
End If

I AM GETTING SYNTAX ERROR CONVERTING DATETIME TO CHARACTER TO STRING

shamsam1
11-22-2008, 03:41 AM
Dim s5 As String, s6 As String, s7 As String, s8 As String
s5 = Text1.text

s6 = Format(s5, "dd/MM/yyyy")
format(Text1.text,yyyy)
s8 = Format(Text1.text, "yyyy-mm-dd")
s7 = Year(s6)
If (s7 Mod 4) <> 0 Then
sql = "SELECT DateAdd(d, 365, 'S8') As NewDate"
Set rs = Con.Execute(sql)
While Not rs.EOF
If rs.BOF = False Then
MsgBox ((NEWDATE))
End If
rs.MoveNext
Wend
End If

I AM GETTING SYNTAX ERROR CONVERTING DATETIME TO CHARACTER TO STRING
sql = "SELECT DateAdd(d, 365, '"& S8 &"') As NewDate"