Home > front end >  Type mismatch: cdate '
Type mismatch: cdate '

Time:09-16

Dim varname, varcode varmail varsex, varhobby, birthday, STRSQL
Varname=trim (request form (" name "))
Varcode=trim (request form (" password "))
Varmail=request form (" email ")
Varsex=request form (" sex ")
Varhobby=request form (" hobby ")

A=request form (" year ")
B=request form (" month ")
C=request form (" day ")
Birthday=a&" - "& amp; B&" - "& amp; C
Birthday=cdate (birthday)
STRSQL="insert into TB (name, password, email, sex, hobby, birthday) values ('" & amp; Varname & amp; "', '" & amp; Varcode & amp; "', '" & amp; Varmail & amp; "', '" & amp; Varsex & amp; "', '" & amp; Varhobby&" ', '" & amp; Birthday&" ')"

CodePudding user response:

Do not need to use the cdate function to convert a birthday to a DateTime type, use the string can be directly, but need to figure out whether this string effective date, so birthday=cdate (birthday) that don't, add the if not isdate (birthday) then birthday='1900-01-01', of course you can also use other date for the default

CodePudding user response:

Good good, top of the building

CodePudding user response:

Data type does not match it is best to use when casting - qwaszx523 blog

CodePudding user response:

On the trill very clock effect to the fire
  •  Tags:  
  • ASP
  • Related