a week ago
Hello,
Is it possible to get a negative value in the selection criteria of a query report?
Please see the sample below:
DECLARE @dayfrom AS INT
DECLARE @dayto AS INT
Select @dayfrom = T0.NumOfDays FROM CDC1 T0 Where T0.NumOfDays = '[%0]' Select @dayfrom = '[%0]'
Select @dayto = T0.NumOfDays FROM CDC1 T0 Where T0.NumOfDays = '[%1]' Select @dayto = '[%1]'
While executing this, we can add a negative sign and the report would should data as per selection criteria.
Ex. -10 & -20
Is it possible to make changes in the report so that the user enters a positive value but the query checks it for negative value, ex: in selection criteria user enters 10 and 20 but the result should display it based on -10 and -20?
Regards,
Joseph
Request clarification before answering.
Hello Joseph,
You can multiply the value by -1:
DECLARE @dayfrom AS INT
DECLARE @dayto AS INT
Select @dayfrom = T0.NumOfDays FROM CDC1 T0 Where T0.NumOfDays = '[%0]' Select @dayfrom = '[%0]' * -1
Select @dayto = T0.NumOfDays FROM CDC1 T0 Where T0.NumOfDays = '[%1]' Select @dayto = '[%1]' * -1
Select @dayfrom, @dayto
Best regards
Inga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joseph,
in my opinion you have 2 ways.
First
When using a date field you are able to insert -10 and the date will already be calculated with the right date, when pressing tab. You need to train your users to do so for your query.
Second
Use a quantity field, here it is possible to insert a negativ value (or find sonething similar)
/*Buchungsdatum*/
/**SELECT FROM [OFPR] T0 **/
DECLARE @DocDateFrom AS Date
/* WHERE */
SET @DocDateFrom = /* T0.F_RefDate */ '[%0]'
/**SELECT FROM [OFPR] T1 **/
DECLARE @DocDateTo AS Date
/* WHERE */
SET @DocDateTo = /* T1.T_RefDate */ '[%1]'
regards Lothar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
15 | |
9 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.