|
-
Apr 25th, 2011, 02:47 PM
#1
Thread Starter
New Member
Reusing SQL Select Statement
Is there a way to reuse a SQL criteria string on the corresponding ADO recordset?
I have created a query for all employees who have either a 10, 20, 25, 30, or 40 year anniversary in the calendar year. I created seperate SQL criteria strings for each of the anniversary dates which I incorporated into my SQL Select statement. I have succesfully created an ADO recordset of all the above employees.
My problem is when I go to compile the report (using Excel 2003), I only want to show those anniversary dates in the corresponding columns e.g. 10, 20, 25, 30 or 40.
If I already have a SQL criteria string for each of the anniveraries, is there a way to say..."If sCriteria10Yr is TRUE then print anniversary date in this column (the 10 year anniversary column) otherwise leave blank".
Nor sure if you can reuse a criteria string within an If/Then in VBA.
I appreciate any insight anyone has to offer.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|