On a form I have a variable that has a control type of "Radio Button". The radio buttons select the choices and assign a number value to the variable.
In a script I am looking at the variables numeric value and then assigning other variables values to a query search. This is almost exactly like the example in Alpha Sport.
Two of the options assign date values that are queried against a "Date" filed in the table. This works like a champ.
The problem I am having is I also want to be able to query a date against a "Time" field, just looking at the "Date" part of the time field. If that makes sense.
In the table I have Date field, Date,D,8,0 that contains the date an invoice was created.
Then there is a Time field, tmsart,T,17,0 that contains the date and time the job is scheduled to be printed. In the query I need to be able to only search against the date part of the time field.
Here is my code.
Thanks..
In a script I am looking at the variables numeric value and then assigning other variables values to a query search. This is almost exactly like the example in Alpha Sport.
Two of the options assign date values that are queried against a "Date" filed in the table. This works like a champ.
The problem I am having is I also want to be able to query a date against a "Time" field, just looking at the "Date" part of the time field. If that makes sense.
In the table I have Date field, Date,D,8,0 that contains the date an invoice was created.
Then there is a Time field, tmsart,T,17,0 that contains the date and time the job is scheduled to be printed. In the query I need to be able to only search against the date part of the time field.
Here is my code.
Code:
if Options = 1 then 'Show invoices by Date filter = "date = [varD->today]" else if Options = 2 then 'Show invoices by range of dates filter = "between(date,[varD->begindate],[varD->enddate])" else if Options = 3 then 'Show invoices by schedule date filter = "tmstart = [varD->today]" else if Options = 4 then 'Show invoices by range of scheduled dates filter = "between(tmstart,[varD->begindate],[varD->enddate])" else if Options = 5 then 'Show All invoices topparent.queryrun("invoice = .t.","tmstart","","No","Wo_Header",.f.) goto DONE end if dim typefilter as c if Options2 = 1 then typefilter = "invoice=.T..AND.exported=.T..AND.export_it=.T." else if Options2 = 2 then typefilter = "invoice=.T..AND.export_it=.T..AND.EXPORTED=.F." else if Options2 = 3 then typefilter = "invoice=.T." else if Options2 = 4 then typefilter = "invoice=.T..AND.exported=.F..AND.EXPORT_IT=.F." end if typefilter = filter+".AND."+typefilter 'substitute the parameters in the filter expression typefilter = replace_parameters(showfilter,local_variables()) topparent.queryrun(typefilter,"tmstart","","no","Wo_Header",.T.)'Run query DONE:
Comment