Hi everyone,
My SQL Server database has 2 tables - 1 contains recent activity, the other contains activity/transactions that are more than 6 months old. Lets call these tables RECENT and HISTORY.
The user selects from a listbox which months data they want to view.
Then I check their selection and assign a Beg and End date for that month.... example
Case "Jan02"
BegDate = "January 2002"
EndDate = "February 2002"
I use BegDate and EndDate in my SQL Select statement...
"Select.... from Recent Where CallDate >= '" & BegDate & "'
AND CallDate < '" & EndDate & "'"
This works perfectly, to my surprise![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
** But I need a trick to determine if BegDate is more than 6 months ago (based on current date) to determine WHICH table to select from Recent or History and that's where I'm stuck. **
Can anyone think of a way ?
Thanks for any suggestions. John
My SQL Server database has 2 tables - 1 contains recent activity, the other contains activity/transactions that are more than 6 months old. Lets call these tables RECENT and HISTORY.
The user selects from a listbox which months data they want to view.
Then I check their selection and assign a Beg and End date for that month.... example
Case "Jan02"
BegDate = "January 2002"
EndDate = "February 2002"
I use BegDate and EndDate in my SQL Select statement...
"Select.... from Recent Where CallDate >= '" & BegDate & "'
AND CallDate < '" & EndDate & "'"
This works perfectly, to my surprise
** But I need a trick to determine if BegDate is more than 6 months ago (based on current date) to determine WHICH table to select from Recent or History and that's where I'm stuck. **
Can anyone think of a way ?
Thanks for any suggestions. John