473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

More Date Issues

Hi,

I'm trying to remove the need for someone to enter a date range for queries because the dates will always be the Sunday through Saturday of the previous week.

Can someone please help me with the "Where" statement I need to put in the queries that will automatically set those dates?

Thanks!
May 15 '08 #1
4 1100
jeffstl
432 Expert 256MB
Hi,

I'm trying to remove the need for someone to enter a date range for queries because the dates will always be the Sunday through Saturday of the previous week.

Can someone please help me with the "Where" statement I need to put in the queries that will automatically set those dates?

Thanks!
So basically you need to write a script that generates 2 dates detecting automatically the dates matching your description of a previous week?

Not easily done. If you really want to do it then try writing a script using the VB Date function that will generate these dates, post problems as you have them.

Another thing you could try is a calander control so the users can input dates easier on a form or something.

Lastly I will say that the ability to enter the date range rather then the program automatically doing it actually leaves some flexibility in your application. What if those dates change? What if you want a larger report from a larger range?

Seems a small price to pay for users to have to enter 2 dates into a parameter box. Especially if its only once per week.
May 15 '08 #2
Thanks jeffstl! I'll try the VB Date function.

I've used the entry form in this application for a while now but I've bought a new automation tool that can run this macro while I'm at home in bed, produce the output in Excel and automatically email the Excel file as an attachment to my distribution list. So, there is some benefit to trying to automate it.

Thanks again!
May 15 '08 #3
missinglinq
3,532 Expert 2GB
Sunday of the previous week
(Date - Weekday(Date) + 1) - 7

Saturday of the previous week
Date - Weekday(Date)

Welcome to Bytes!

Linq ;0)>
May 15 '08 #4
jeffstl
432 Expert 256MB
Sunday of the previous week
(Date - Weekday(Date) + 1) - 7

Saturday of the previous week
Date - Weekday(Date)

Welcome to Bytes!

Linq ;0)>
Good! There you go OP.

I figured there was a way but I didn't have it in the front of my mind.

You can take the value obtained and pass them to your SQL. I assume since your query already accepted 2 parameters that its ready to accept these calculated values.
May 15 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: sandy | last post by:
Hi, Using Java script I am trying to create code where when you place in the start date it automatically calculates 6 months for the experations date. For example when I place 01/01/04 as the...
2
by: Riegn Man | last post by:
I have a problem with access and our time clocks. We have time clocks that put out a .log file with the badge swipes for everybody. There is one .log file for each day. I am pulling that data...
3
by: Sam | last post by:
Hi, I store the date selected in a datetimepicker into a sqlserver table in a SmallDateTime field. To be compatible with the date format of my sql server, I convert the date as following: Dim...
38
by: sopranos2 | last post by:
Dear IBM DB2 support, I wish CLP would have been more functional. Without living the command line I would like to get sql return code explanations, scalar function definitions etc.. Looking...
7
by: mr.nimz | last post by:
hello, this is antenio. recently i've come to a problem. i got a way through it, somehow, still it left me in a curious state, so i'm posting it here, if i can get an answer from some techy, ...
2
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
4
by: sck10 | last post by:
Hello, I created an ashx file for my rss feed (rss.ashx). I notice on the site (http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml) that the date (Yesterday, October 30, 2006, 3:02:37 PM)...
4
by: | last post by:
Using VS.NET I am wondering what methods developers use to deploy ASP.NET website content to a remote server, either using FTP or network file copy. Ideally there would be a one-button or...
4
by: GaryDean | last post by:
I posted an earlier message on this subject and received links to some old 1.1 docs that didn't do any good. Since then I fouund a book on WSE 3.0 that tells, in some detail, how to develop a web...
6
by: WT | last post by:
Hello, Using url rewritting and ajax.net, I tried to circumvent some potential problems with postback url using a code from a sample given by Scott. The idea is to use a control Adapter on...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.