I have tried to create a subquery which will produce a list of employees who have anniversary hire dates within a certain date parameter ([Start Date],[End Date]). The table I'm querying from is Employee Info; the field name is Hire Date. I think I may be having a problem with the new year (switching from 2004 to 2005????), although all of my dates are formatted as mm/dd/yyyy. I attempted to use the following SQL Select statement.
Annual Review: (Select [Hire Date] From [Employee Info] Where DateSerial(2000,DatePart("m",[Hire Date],0,0),DatePart("d",[Hire Date],0,0)) Between DateSerial(2000,DatePart("m",[Start Date],0,0),DatePart("d",[Start Date],0,0)) And DateSerial(2000,DatePart("m",[End Date],0,0),DatePart("d",[End Date],0,0)))
However, the error I received was: "At most, one record can be returned by this subquery." I entered the date parameters (for the entire year, just to test) in the long format with a 4-digit year.
I want to be able to produce a report on a monthly basis with all of the anniversaries for employee hire dates.
I have little training in SQL Select statements and extremely limited knowledge of VB, but I am willing to use whatever knowledge any of you may have to offer!
Thanks in advance for your help!!!!
Kim
Annual Review: (Select [Hire Date] From [Employee Info] Where DateSerial(2000,DatePart("m",[Hire Date],0,0),DatePart("d",[Hire Date],0,0)) Between DateSerial(2000,DatePart("m",[Start Date],0,0),DatePart("d",[Start Date],0,0)) And DateSerial(2000,DatePart("m",[End Date],0,0),DatePart("d",[End Date],0,0)))
However, the error I received was: "At most, one record can be returned by this subquery." I entered the date parameters (for the entire year, just to test) in the long format with a 4-digit year.
I want to be able to produce a report on a monthly basis with all of the anniversaries for employee hire dates.
I have little training in SQL Select statements and extremely limited knowledge of VB, but I am willing to use whatever knowledge any of you may have to offer!
Thanks in advance for your help!!!!
Kim