datetime - Have a date in vb.net surrounded by # signs what do they do? -
usually when comparing date hard coded use string, query brings #1/1/0001 12:00:00 am# if date hasn't been set in 400 database. tired comparing "1/1/0001 12:00:00 am" because though other error seems work find in comparison date time. # mean in instance.
if lastchg <> #1/1/0001 12:00:00 am# ''do stuff end if
lastchg declared date or datetime. date vb alias system.datetime. cannot compare date value string, can compare date constant date variable. #1/1/0001 12:00:00 am# so-called date literal , of type date. textual representation of date constant.
you write
const emptydate date = #1/1/0001 12:00:00 am# if lastchg <> emptydate ''do stuff end if in case make sure if lastchg of type date compare date literal (with #), if string string literal (with ")
Comments
Post a Comment