search records based on string name of month compared to data format
Posted on 2014-07-22
I have a database table in sql where I have attendance records. The ActivityDate column has a datatype of date.
In my vb6 form I have a dropdown box that the user selects which month they are looking to query. ie. "January, February, March, etc..."
Once they select a month, how can I use the month name "January" to select all records that contain a January ActivityDate?
Would this be correct?
select * from tblOrgHours where ActivityDate = DATENAME(January, GETDATE())