I have a table that contains a couple of million records. The records are individual services provided by a couple hundred service providers. Most of what I need to review (the table is updated on a weekly basis) revolves around monthly service totals for each of the providers. An example of some typical rows would be:
PROVIDER DATE SERVICE UNITS BILLED
SUPPORT 7/21/2003 COUNSELING 1 $80.00
SUPPORT 7/28/2003 COUNSELING 1 $80.00
SUPPORT 9/21/2003 COUNSELING 1 $80.00
JAIL 7/21/2003 ASSESSMT 1 $80.00
JAIL 7/23/2003 ASSESSMT 1 $80.00
JAIL 8/21/2003 COUNSELING 1 $80.00
Since creating the totals on the fly in views or within a reporting package takes forever, I’m trying to create a summary table that would look something like this:
PROVIDER DATE SERVICE UNITS BILLED
SUPPORT 7/2003 COUNSELING 2 $160.00
SUPPORT 9/2003 COUNSELING 1 $80.00
JAIL 7/2003 ASSESSMT 2 $160.00
JAIL 8/2003 COUNSELING 1 $80.00
The problem that I am having is with the date. Can I have a date formatted as “7/2003” and still have it maintain its date properties for selection and sorting purposes ( I’d like to be able to create a where clause that will select, for example, all the entries between 1/2003 and 12/2003)?
Thanks for the help,
Nick
PROVIDER DATE SERVICE UNITS BILLED
SUPPORT 7/21/2003 COUNSELING 1 $80.00
SUPPORT 7/28/2003 COUNSELING 1 $80.00
SUPPORT 9/21/2003 COUNSELING 1 $80.00
JAIL 7/21/2003 ASSESSMT 1 $80.00
JAIL 7/23/2003 ASSESSMT 1 $80.00
JAIL 8/21/2003 COUNSELING 1 $80.00
Since creating the totals on the fly in views or within a reporting package takes forever, I’m trying to create a summary table that would look something like this:
PROVIDER DATE SERVICE UNITS BILLED
SUPPORT 7/2003 COUNSELING 2 $160.00
SUPPORT 9/2003 COUNSELING 1 $80.00
JAIL 7/2003 ASSESSMT 2 $160.00
JAIL 8/2003 COUNSELING 1 $80.00
The problem that I am having is with the date. Can I have a date formatted as “7/2003” and still have it maintain its date properties for selection and sorting purposes ( I’d like to be able to create a where clause that will select, for example, all the entries between 1/2003 and 12/2003)?
Thanks for the help,
Nick