Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Prompted dates for an sp_report in an Access QuerySearch Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v6 Forum

 New Topic 
 
 Post Reply 
[1]  
 Prompted dates for an sp_report in an Access Query 
 Author   Message 
  Bryon 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-06-24 
 Profile
 Posted : 2006-06-24 15:44:19
I have copied the provided example SQL for an sp_report into an Access pass through query. How can I modify this to allow for user prompted date ranges? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-25 10:53:27
You will need to use VBA and some input boxes for the date selection or simply change the date range in your Query. Otherwise you can simply program the date range as part of the report based on the current date. See Referencing TODAY's date minus 30 days in a WHERE clause? for an example of this. 

  Top 
  Bryon 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-06-24 
 Profile
 Posted : 2006-06-26 10:19:49

Does this mean that I cannot use the example scripts as a starting point for my reports?

I'm trying to get the Profit & Loss by Class report  to show amounts by month for the last 12 months. The DateMacro='Custom' and the SummarizeColumnsBy='Month'. I'm assuming that I must use the DateFrom and DateTo fields for the user to specify a date range unless there is a way using SQL to identify which month I want to start from (current or previous) and have it go back 12 months to include a full year of data.

Any suggestions?

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-06-26 12:32:28

Yes, you will need to use the DateFrom and DateTo parameters or select one of the pre-defined DateMarco parameters like this:

sp_report ProfitAndLossByClass show Amount_Title, Text, Label, Amount parameters DateFrom = {d'2005-06-26'}, DateTo ={d'2006-06-26'}, SummarizeColumnsBy = 'Class'

sp_report ProfitAndLossByClass show Amount_Title, Text, Label, Amount parameters DateMacro = 'ThisYearToDate', SummarizeColumnsBy = 'Class'

COMMON sp_report PARAMETERS PARAMETER VALUES
DateFrom = {d'yyyy-mm-dd'}
DateTo = {d'yyyy-mm-dd'}
DateMacro =

 

  Top 
  Bryon 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-06-24 
 Profile
 Posted : 2006-07-07 03:14:54
Thank you. How can I prompt the user for a date range then? Can I do it using the sp_report example? 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-07-07 08:25:07
You will need to use VBA programming and some input boxes for the date selection and move the values into date variables and use them in the DateFrom and DateTo parameters for your sp_report. 

  Top 
  Bryon 
  
 Group: Members 
 Posts: 7 
 Joined: 2006-06-24 
 Profile
 Posted : 2006-07-07 12:40:42

Thank you.

Do you have any examples of code on how to do this? I can create the input boxes in VBA for input. I'm not sure how to get the dates entered by the user back into the stored procedure.

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-07-07 14:25:05

Try starting with: Running an sp_report in Access using VBA 

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to