WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-14-2003, 09:59 AM
pete61uk's Avatar
pete61uk pete61uk is offline
WebProWorld Veteran
 

Join Date: Jul 2003
Location: United Kingdom - Wales
Posts: 353
pete61uk RepRank 0
Default Parameter Query "HELP"

Hi All,

I need an Access2K query (Table[OrderDate]) to veiw reports going back a 'week' (7 days) based on (and including) the user-defined date.

I've been trying to get it going for hours without any success. Can anyone help?
__________________
Pete

www.celna.co.uk

Nothing ever changes - Still stuck in the same damned corner!
Reply With Quote
  #2 (permalink)  
Old 12-14-2003, 10:54 AM
Narasinha's Avatar
Narasinha Narasinha is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Urbana, Illinois, US
Posts: 306
Narasinha RepRank 1
Default Re: Parameter Query "HELP"

Quote:
Originally Posted by pete61uk
Hi All,

I need an Access2K query (Table[OrderDate]) to veiw reports going back a 'week' (7 days) based on (and including) the user-defined date.

I've been trying to get it going for hours without any success. Can anyone help?
Okay, you want to do something like this, right?

SELECT * from TABLE where ((Table.OrderDate) Between (selectedDate) And (selectedDate - 7))

In "Design View" for the query you would have in the "Criteria" section Is Not Null And Between [BeginningDate] And [EndingDate]

It's been a while since I created SQL queries in Access. I don't recall exactly how Access does computations with fields of type Date. Is this for a web-connected database?
Reply With Quote
  #3 (permalink)  
Old 12-14-2003, 12:29 PM
pete61uk's Avatar
pete61uk pete61uk is offline
WebProWorld Veteran
 

Join Date: Jul 2003
Location: United Kingdom - Wales
Posts: 353
pete61uk RepRank 0
Default

Narasinha,

Thank you for your post. You wrote:

"SELECT * from TABLE where ((Table.OrderDate) Between (selectedDate) And (selectedDate - 7))

In "Design View" for the query you would have in the "Criteria" section Is Not Null And Between [BeginningDate] And [EndingDate]"


Sorry, its not a between dates function. What is needed is one of two things. Either:

1) A parameter query where the user inputs a single date and the result is a list displaying transactions covering a seven day period. Or (I'm guessing here):

2) An expression that will display a weeks worth of transactions on the day (date()) of the query.

This is tricky, I know. I've looked through the no-help files and a book on Access2K and the date functions are a nightmare.
__________________
Pete

www.celna.co.uk

Nothing ever changes - Still stuck in the same damned corner!
Reply With Quote
  #4 (permalink)  
Old 12-15-2003, 12:37 AM
pete61uk's Avatar
pete61uk pete61uk is offline
WebProWorld Veteran
 

Join Date: Jul 2003
Location: United Kingdom - Wales
Posts: 353
pete61uk RepRank 0
Default

No luck figuring-out a user-defined parameter query.

However, the following does give seven days worth of reports from the date queried.

>DateAdd("d",-7,Date())
__________________
Pete

www.celna.co.uk

Nothing ever changes - Still stuck in the same damned corner!
Reply With Quote
  #5 (permalink)  
Old 12-15-2003, 03:50 AM
Narasinha's Avatar
Narasinha Narasinha is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Urbana, Illinois, US
Posts: 306
Narasinha RepRank 1
Default MS Access

Oh, wait a second. (I'm assuming you want this function locally, not web-based) You want a requestor to pop up asking for the specific date? I've done this before with invoicing database I made for work.
Reply With Quote
  #6 (permalink)  
Old 12-15-2003, 04:58 AM
paulhiles's Avatar
paulhiles paulhiles is offline
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: UK
Posts: 2,803
paulhiles RepRank 0
Default Which method?

Hi Pete,

Quote:
Originally Posted by Narasinha
(I'm assuming you want this function locally, not web-based)
Narasinha raises a valid point here... are you working with forms in Access itself? OR are you querying an Access database using ASP and SQL queries? I've basic experience of using both methods... but it would be useful if you gave a bit more detail on how your user would interact with the database.

Also, I deleted the Poll and corresponding thread in the Break Room.. as you pointed out... there was little, if any interest there! :c)

Paul
Reply With Quote
  #7 (permalink)  
Old 12-16-2003, 05:11 AM
pete61uk's Avatar
pete61uk pete61uk is offline
WebProWorld Veteran
 

Join Date: Jul 2003
Location: United Kingdom - Wales
Posts: 353
pete61uk RepRank 0
Default

Narasinha wrote:
(I'm assuming you want this function locally, not web-based)

The function was required for a report generated by Access 2000 itself. Though, if there is a perameter query that works I'd still be interested.

However, there do seem to be a lot of cross-compatability issues as not all parameters migrate successfully to all Access versions?

Paul. To be honest, the poll was as much to find out just how much interest there is in Access (for future reference) as it was to draw attention to my need for help.

As it was, after way too many hours scratching my now receding and thinning hairline, I managed to find the solution. It is good to know that at least this time someone was kind enough to respond.

Thank you both.
__________________
Pete

www.celna.co.uk

Nothing ever changes - Still stuck in the same damned corner!
Reply With Quote
  #8 (permalink)  
Old 12-16-2003, 11:51 AM
Narasinha's Avatar
Narasinha Narasinha is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Urbana, Illinois, US
Posts: 306
Narasinha RepRank 1
Default

Quote:
Originally Posted by pete61uk
The function was required for a report generated by Access 2000 itself. Though, if there is a perameter query that works I'd still be interested.
I'm glad you found what you needed. I used something similar in a report in Access. When you run the report for the monthly invoices, a pop-up requests the month, then another yes/no choice.

Quote:
Originally Posted by pete61uk
Thank you both.
You're quite welcome. I certainly don't consider myself an expert with Access (I used to do mostly SQL queries through Perl to Access databases), but I'm willing to lend a hand when I can.
Reply With Quote
  #9 (permalink)  
Old 12-17-2003, 05:29 AM
pete61uk's Avatar
pete61uk pete61uk is offline
WebProWorld Veteran
 

Join Date: Jul 2003
Location: United Kingdom - Wales
Posts: 353
pete61uk RepRank 0
Default

The tricky thing with questions like this is in that if you need to ask the question at all, it implies a certain "sense of urgency".

As such, the timelyness of any feedback is (if only psychologically) important. Even if it doesn't provide the answer needed it can point in an otherwise not thought of direction that will?

I had spent a thoroughly frustrating two days before I (out of despair) submitted the post. However, in doing so, it cleared my head and, as luck would have it, the answer came to me.

Narasinha wrote:

"When you run the report for the monthly invoices, a pop-up requests the month, then another yes/no choice"

I'd be interested in knowing how you did this, and why the yes/know?

Again, my thanks
__________________
Pete

www.celna.co.uk

Nothing ever changes - Still stuck in the same damned corner!
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: parameter, query, quothelpquot



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0