Query ASK AT RUNTIME date range

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
kwokm67
Posts: 49
Joined: Tue Apr 14, 2009 1:14 pm

Query ASK AT RUNTIME date range

Post by kwokm67 »

Is it possible to ASK AT RUNTIME in a Query for a date range?

For example dates between 01/01/2009 to 12/01/2009?

If this is covered elsewhere in the forums please point me to the right direction.

Many thanks.
BobK
Posts: 546
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

Yes it is possible.


Just have two where clauses


Order.EnteredDate >= (Ask at run-time) AND
Order.EnteredDate <= (Ask at run-time)
Bob
kwokm67
Posts: 49
Joined: Tue Apr 14, 2009 1:14 pm

Post by kwokm67 »

Thanks for the quick response.

I thought that is all I need to do but I only get prompt once for the date.
Running Mac OS X 10.6.3, FireFox 3.6.3, Aware IM V4.9 (Build 1322)
BobK
Posts: 546
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

It has been awhile since I did this and I forgot to mention the following:

After doing the above, go to the 'Rule Form' tab.
It should display something like:

FIND DateSearches WHERE DateSearches.EndDate<=?'End Date' AND DateSearches.EndDate>=?'End Date'

Change it to something like (change in bold):

FIND DateSearches WHERE DateSearches.EndDate<=?'Start Date' AND DateSearches.EndDate>=?'End Date'



I just guessing, but I think you need two different values for the labels.
Bob
BobK
Posts: 546
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

Excuse the typo. I got the '<=' and '>=' in the wrong order in the above example.
Bob
kwokm67
Posts: 49
Joined: Tue Apr 14, 2009 1:14 pm

Post by kwokm67 »

Many, many thanks!
Running Mac OS X 10.6.3, FireFox 3.6.3, Aware IM V4.9 (Build 1322)
kwokm67
Posts: 49
Joined: Tue Apr 14, 2009 1:14 pm

Post by kwokm67 »

Hi Bob,

I would like the "From Date" and "To Date" to appear on my report heading. Is this possible?

Many thanks,

Kwok
Running Mac OS X 10.6.3, FireFox 3.6.3, Aware IM V4.9 (Build 1322)
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

That would be a bit more complicated, but possible.

1) Use attributes in RegularUser BO

2) When running a process to print the reports, have a form that allows input of the dates in the RegularUser BO

3) Use the RegularUser attributes on the query that generates the report & in the title are of the report.
Tom - V8.8 build 3137 - MySql / PostGres
BobK
Posts: 546
Joined: Thu Jan 31, 2008 2:14 pm
Location: Cincinnati, Ohio, USA

Post by BobK »

I solved this problem by basically doing what Tom suggests.

The only difference is that I do not like clogging up the RegularUser BO with attributes that are not needed by the RegularUser. I have a MiscObject BO that I use for these types of attributes. Since my MiscObject is not needed after the process that creates the report, the Persistence is set to 'Not persisted'
Bob
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

Good idea Bob. Thanks for sharing it.
Tom - V8.8 build 3137 - MySql / PostGres
kwokm67
Posts: 49
Joined: Tue Apr 14, 2009 1:14 pm

Post by kwokm67 »

Thank you both very much.
Running Mac OS X 10.6.3, FireFox 3.6.3, Aware IM V4.9 (Build 1322)
Post Reply