This topic is locked

before sql query

6/22/2011 7:59:15 AM
ASPRunnerPro General questions
M
mik author

hi...
i have this on add page:
waybill no:

from: date*

to: *date

subtotal:
how can i put a button on the add page which will open a report and make [
from] and [to**] from the add page the date range of the report?can someone pls help me how to do this...and can i also display the date range on the report?tnx much
this is the report:
SELECT

id,

rate,

[date]

FROM pullouts

Sergey Kornilov admin 6/23/2011

Don't have a code sample. Just a high level idea of how this can be done.

  1. Button can utilize Javascript API to the the content of field values

    More info on getValue() function:

    http://xlinesoft.com/asprunnerpro/docs/ctrl_getvalue.htm
  2. Craft the URL passing from and to dates. Open new page in popup.

    More info: http://www.blazonry.com/javascript/windows.php
  3. Use BeforeSQLQuery event to add a filter. To access variables passed via URL use Request.QueryString("variablle_name")

    Example of modifying SQL Query on the fly:

    http://xlinesoft.com/asprunnerpro/docs/dynamic_sql_query.htm

M
mik author 6/25/2011

hi...tnx for the reply...but it did not work for me..

i have a new idea i hope this will work.. can i display this table (SELECT id,rate,[date]FROM pullouts where date between values("from") and values("to")) as details
it should look like this on add page if im right..i hope
waybill no:

from: date

to:
date

subtotal:
displayas details(SELECT id,rate,[date]FROM pullouts where date between values("from") and values("to"))
do you have asp code for this?...tnx much for your time..

Sergey Kornilov admin 6/25/2011

You need to use the same Dynamic SQL Query approach to add a WHERE clause.
If you need help writing code for this post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.