TomPhillips
Active member
- Joined
- Feb 24, 2005
- Messages
- 33
- Programming Experience
- 10+
What is the simplest and quickest code to determine if a record exists? Say I have a table of holidays and dates. I have a date I want to see is a holiday. Yes, No, thats all. So I try something like:
Dim myDate as DateTime = DateTime.now()
Dim isHoliday as Boolean = False
Dim strSQL as string = "Select count(*) from HolTable where hDate = '" & myDate & "''
How to get isHoliday set to true for '12/25/2005' and false for now()? I could use a data reader but that seems like overkill. What am I missing?
Dim myDate as DateTime = DateTime.now()
Dim isHoliday as Boolean = False
Dim strSQL as string = "Select count(*) from HolTable where hDate = '" & myDate & "''
How to get isHoliday set to true for '12/25/2005' and false for now()? I could use a data reader but that seems like overkill. What am I missing?