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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -