on 11-19-2014 10:51 AM
Hi,
Try this,
Where T0.Docdate between {?FromDate} and {?ToDate}
Thanks & Regards,
Alvin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
DocDate from OINV table is of date data type right?
Can you explain about [%0] and [%1] values passed to DocDate and the format?
Thanks,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikunj,
So, [%0] and [%1] are date data type prompts?
1. Try running the report by commenting the where clause for date part and check for which date of DocDate you have data.
2. Then try checking for the date range which includes the dates for which you got data in step 1.
3. If you still not getting the data, then you may have to check the other where clause conditions whether you are having data for those conditions.
Thanks,
Raghavendra
Hi Nikunj,
Yes,
It will give the data for whole year if you comment date prompts. The reason for asking you to do that was, to check for which dates you have data.
Now you know that you are getting data for some dates if not all. Note down those dates and uncomment the date range parameter clause in your command query and try running the report again by passing a date range which includes the dates you have noted down.
Thanks,
Raghavendra
Hi Raghavendra,
as per your conclusion,
i also try it but it will give me blank output on crystal report.
i attach query :
SELECT sum(T0.[DocTotal] - T0.[VatSum]) 'assessable value' , Sum( T0.[VatSum]) 'Tax Amount' , ((sum(T0.[DocTotal] - T0.[VatSum]) * 4)/100) 'Vat @ 4%' , ((sum(T0.
[DocTotal] - T0.[VatSum]) * 1)/100) 'Vat @ 1%' FROM [dbo].[OINV] T0 Where T0.DocDate between '[%0]' and '[%1]'
UNION ALL
SELECT sum(T0.[DocTotal] - T0.[VatSum]) 'assessable value1' , Sum( T0.[VatSum]) 'Tax Amount1' , ((sum(T0.[DocTotal] - T0.[VatSum]) * 4)/100) 'Vat @ 4%1' , ((sum(T0.
[DocTotal] - T0.[VatSum]) * 1)/100) 'Vat @ 1%1' FROM [dbo].[ORIN] T0
UNION ALL
SELECT sum(T0.[DocTotal] - T0.[VatSum]) 'assessable value2' , Sum( T0.[VatSum]) 'Tax Amount2' , ((sum(T0.[DocTotal] - T0.[VatSum]) * 4)/100) 'Vat @ 4%2' , ((sum(T0.
[DocTotal] - T0.[VatSum]) * 1)/100) 'Vat @ 1%2' FROM [dbo].[OPCH] T0
UNION ALL
SELECT sum(T0.[DocTotal] - T0.[VatSum]) 'assessable value3' , Sum( T0.[VatSum]) 'Tax Amount3' , ((sum(T0.[DocTotal] - T0.[VatSum]) * 4)/100) 'Vat @ 4%3' , ((sum(T0.
[DocTotal] - T0.[VatSum]) * 1)/100) 'Vat @ 1%3' FROM [dbo].[ORPC] T0
Hi Nikunj,
Best method to debug your query (as it's having 4 queries combined using Union ALL), is to try including one query at a time without any command level filtering using prompts.
If the query is giving some data, then try adding your prompts one by one and execute the report each time to make sure you are getting some data for the prompts you are including.
Say one query is perfect and giving output with all prompts. Then try the same steps for other queries also.
If everything goes well, try combining them using Union ALL.
If individual queries are giving output, then your combined query (using Union ALL) will also have data even if one of your queries is retrieving some data.
Hope you will get some hint on how to proceed.
Thanks,
Raghavendra
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.