grizzlyjdw2
01-26-2010, 06:45 AM
is there a way to automate a querry to run for the current week?
for example if i ran it today it would run for 1-24-10 -- 1-30-10
for example if i ran it today it would run for 1-24-10 -- 1-30-10
|
View Full Version : automate querry grizzlyjdw2 01-26-2010, 06:45 AM is there a way to automate a querry to run for the current week? for example if i ran it today it would run for 1-24-10 -- 1-30-10 Guus2005 01-26-2010, 07:18 AM To run a query each day for a week, you need to program the form timer event. To run a query with a dynamic date variable, use select * from tablename where somedate between date and date+7 Enjoy! grizzlyjdw2 01-26-2010, 07:26 AM that isn't going to go back and pick up the previous days in the week is it? like if i run it for jan 27 i want it to pull 1-24-10 -- 1-30-10 is that possible? gemma-the-husky 01-26-2010, 07:36 AM so you need to decide which week day is the first day (eg monday) and if today isnt a monday, go back till you get one. then use mondaysdate to mondaysdate+6 (rather than plus 7) grizzlyjdw2 01-26-2010, 09:52 AM ok, that makes sense. how would you do that in SQL though? |