How to display results of a report based on current year
Hi,
Please advice me for the following requirement.
I have a report which is having sales results, which is having year column also. Report has to be displayed based on the current year. Now it is 2013. I should show current year results only i.e 2013.
In 2014, i should show only 2014 results. How to achieve this at a report level.
regards
CK.
Hi CK,
You are having Data for 2014 also. If not means, you can use sql query select max(year) from period.
So it will show the final maximum end of the year(2013) from database.
You can use dashboard prompts too. in the prompt also you can have specific year or sql query
http://mkashu.blogspot.com
Regards,
VG
Similar Messages
-
R12: How to filter Open Item Revaluation Report based on GL Date
Hi,
Anybody know how to filter Open Item Revaluation Report based on GL Date from and GL Date to in R12?
Since we just upgraded from 11.5.10 to 12.1.3 and found we cannot filter those report for specific date. It shown all data included the old data from 8 years ago also.
We need to run the report only for specific date only. Please share with me if anyone know about this.
Thanks.Pl do not post duplicates - R12: How to filter Open Item Revaluation Report based on GL Date
-
How to display data from a recordset based on data from another recordset
How to display data from a recordset based on data from
another recordset.
What I would like to do is as follows:
I have a fantasy hockey league website. For each team I have
a team page (clubhouse) which is generated using PHP/MySQL. The one
area I would like to clean up is the displaying of the divisional
standings on the right side. As of right now, I use a URL variable
(division = id2) to grab the needed data, which works ok. What I
want to do is clean up the url abit.
So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end all
I want is clubhouse.php?team=Wings.
I have a separate table, that has the teams entire
information (full team name, short team, abbreviation, conference,
division, etc. so I was thinking if I could somehow do this:
Recordset Team Info is filtered using URL variable team
(short team). Based on what team equals, it would then insert this
variable into the Divisional Standings recordset.
So example: If I type in clubhouse.php?team=Wings, the Team
Info recordset would bring up the Pacific division. Then 'Pacific'
would be inserted into the Divisional Standings recordset to
display the Pacific Division Standings.
Basically I want this
SELECT *
FROM standings
WHERE division = <teaminfo.division>
ORDER BY pts DESC
Could someone help me, thank you.Assuming two tables- teamtable and standings:
teamtable - which has entire info about the team and has a
field called
"div" which has the division name say "pacific" and you want
to use this
name to get corresponding details from the other table.
standings - which has a field called "division" which you
want to use to
give the standings
SELECT * FROM standings AS st, teamtable AS t
WHERE st.division = t.div
ORDER BY pts DESC
Instead of * you could be specific on what fields you want to
select ..
something like
SELECT st.id AS id, st.position AS position, st.teamname AS
team
You cannot lose until you give up !!!
"Leburn98" <[email protected]> wrote in
message
news:[email protected]...
> How to display data from a recordset based on data from
another recordset.
>
> What I would like to do is as follows:
>
> I have a fantasy hockey league website. For each team I
have a team page
> (clubhouse) which is generated using PHP/MySQL. The one
area I would like
> to
> clean up is the displaying of the divisional standings
on the right side.
> As of
> right now, I use a URL variable (division = id2) to grab
the needed data,
> which
> works ok. What I want to do is clean up the url abit.
>
> So far the url is
clubhouse.php?team=Wings&id=DET&id2=Pacific, in the end
> all
> I want is clubhouse.php?team=Wings.
>
> I have a separate table, that has the teams entire
information (full team
> name, short team, abbreviation, conference, division,
etc. so I was
> thinking if
> I could somehow do this:
>
> Recordset Team Info is filtered using URL variable team
(short team).
> Based on
> what team equals, it would then insert this variable
into the Divisional
> Standings recordset.
>
> So example: If I type in clubhouse.php?team=Wings, the
Team Info recordset
> would bring up the Pacific division. Then 'Pacific'
would be inserted into
> the
> Divisional Standings recordset to display the Pacific
Division Standings.
>
> Basically I want this
>
> SELECT *
> FROM standings
> WHERE division = <teaminfo.division>
> ORDER BY pts DESC
>
> Could someone help me, thank you.
> -
How to display result of database query in JFrame?
How to display result of oracle database query in JFrame?
This is part of my code:
String username, password;
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
OracleConnection conn = DriverManager.getConnection(String url, String username, String password);
Statement s= conn.createStatement();
ResultSet q= s.executeQuery("SELECT A, B, C FROM TABLE X");
Forget what url, username & password are. Is there any problem with my code?
What should be next if I want to display result of the query in a table in JFrame?Thx !How to create JTable with unknown no. of rows? How to get no. of rows of a query?
I saw the demo of creating JTable on java.sun.com but the the table has a certain no. of rows which is not applicable to my case.
Suppose the result of query is a table with 3 attributes so there are 3 columns in the table.
R contains the result of the query.
Should it be something like this if I want to create JTable of the query?
How to make n rows of {R.getString(1),R.getString(2),R.getString(3)};?
public SimpleTableDemo() {
super(new GridLayout(1,0));
String[] columnNames = {"A",
"B",
"C",
while (R.next())
// content of a row
Object[][] data = {R.getString(1),R.getString(2),R.getString(3)};
I can't run it because I still can't debug my code which is said before.
Thx! -
Doubt , how to display ole objects in report builder
Please tell me, how to display ole objects in report builder.
I mean i wanted to print ole object in report, so how to do that.Just to clarify Lixia's response.
In Reports 9i we have deprecated our OLE functionality. Reports created in prior versions that contain OLE objects should still run, but you will not be able to create new reports containing OLE objects. -
Each year for the past 5 years I make a family calendar and send copies to all he family members around the globe. I hate that I have to recreate all the birthdays and special occasions from scratch, and re-drag all the photos onto these dates, in the lower half of the page of each month on the new calendar. How can I create a new calendar for the current year and port all of these photos/comments into the new calendar from last years calendar, to save having to redo all this work!! I am not talking about the upper half page of the photos only...I am referring to the calendar page of each month.
Thanks in advance.
ColinWelcome to the Apple Discussions. Open iWeb so you see your original site in the left hand pane. Use the File->New Site menu option to create a new site. Give it the name you want.
Now select a page in your original site and type Command+D. That will duplicate the page. Drag the duplicate page down to the new site and rename it as needed. Do that for the other pages you need in the original site.
OT -
How to display results set of multiple reports into a single report table
Our goal is to create a single report (or dashboard) that shows the "funnel" of object creations related to each campaign. The flow goes from Activity to Lead to Opportunity as well as multiple steps within each (ie. Unqualified Lead -> Qualified Lead, etc).
We currently have 3 separate reports in three different subject areas, each reporting the different metrics and we would like to combine the output into a single Unified report.
For example what we currently have is:
Activities:
Campaign Name # of Activities
Campaign A 12
Campaign B 26
Leads:
Campaign Name # of Leads # of Qualified Leads
Campaign A 10 4
Campaign B 20 18
Opportunities:
Campaign Name # of Opportunities # of Opps per Sales Stage ... # of Wins Closed Revenue
Campaign A 3 2 1 $1,000.00
Campaign B 10 8 3 $2,800.00
What we want to see is:
Combined:
Campaign Name - Campaign Cost - # of Activities - # of Leads - # of Qualified Leads - # of Opportunities - # of Opps per Sales Stage - # of Wins - Closed Revenue
Campaign A - $423.00 - 12 - 10 - 4 - 3 - 2 - 1 - $1,000.00
Campaign B - $ 1,000.00 - 26 - 20 - 18 - 10 - 8 - 3 - $2,800.00
We have tried using the "Combine with similar analysis" but the number of columns for each subject area differ. We also tried creating multiple UNION criteria (one for each column), but in the case of # of Opps per Sales Stage and Closed Revenue, those are not "Metrics" fields, so they won't combine.Hi, You may have to create some dummy fields to equate the no. of field in each of the report matching the data type too and get a one single report using combined analytics and then using the resultant data you can create a simple pivot like below. Haven't tried it before
-- Venky CRMIT
Hi Venky,
I am facing the same problem. Can you please say Steps how to create resultant data and Combine in pivot Table .
Please Help me .
Thanks in Advance .
My mail id is :
[email protected] -
How to display images in custom reports?
Hi,
I have a table with a ordsys.ordimage field, where I am uploading images. I created a custom report based on that table but I just cant seem to find a way to show images in it. Could anyone please tell me how to do this.Assuming you are using PSQuery.
In your query go to the expressions tab.
Add in the following:
SUBSTR(sys_context('USERENV', 'CLIENT_INFO'), 1, INSTR(sys_context('USERENV', 'CLIENT_INFO'), ',', 1, 1) - 1)
That will return who is running the query in your results.
Then you use this field in your XMLP template.
hat tip to
http://jjmpsj.blogspot.com/2006_09_03_archive.html -
How to display page numbers in report
hi all,
i would like to know how to display page numbers in this format " 1 of 5" in the report.
Any help would be much appreciated.
thanks
seemaHi,
Check this too...
Page No. in ALV output
If you query is solved, kindly close the thread.
Regards,
Anjali
Message was edited by: Anjali Devi Vishwanathan -
How to send result of a report as an email
hi experts,
how to send the result of a report as an email to the user.
plz help
regards,
malleswari.Hi,
Check this Weblog:
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
Check these link as well..
http://www.sap-img.com/abap/sending-email-with-attachment.htm
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
I did a search in the forum, an di found lot of threads to send mail from ALV ....
Look at the below threads
How to send ALV list report as html attachment in a mail??
https://www.sdn.sap.com/irj/sdn/forumsearch
How to send ALV report by mail
Re: How to send an ALV Grid Report to SAP user mail ?
Re: How to send an ALV Grid Report to SAP user mail ?
Have a look at below code:
REPORT ZSENDEXTERNAL.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Send External Mail'.
Mail Contents
OBJTXT = 'Minimum bid : $250000'.
APPEND OBJTXT.
OBJTXT = 'A representation of the pictures up for auction'.
APPEND OBJTXT.
OBJTXT = 'was included as attachment.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
(Assume that the data in OBJBIN is in BMP format)
*OBJBIN = ' O/ '. APPEND OBJBIN.
*OBJBIN = ' | '. APPEND OBJBIN.
*OBJBIN = ' / '. APPEND OBJBIN.
*DESCRIBE TABLE OBJBIN LINES TAB_LINES.
*OBJHEAD = 'PICTURE.BMP'.
*APPEND OBJHEAD.
Creation of the entry for the compressed attachment
*OBJPACK-TRANSF_BIN = 'X'.
*OBJPACK-HEAD_START = 1.
*OBJPACK-HEAD_NUM = 1.
*OBJPACK-BODY_START = 1.
*OBJPACK-BODY_NUM = TAB_LINES.
*OBJPACK-DOC_TYPE = 'BMP'.
*OBJPACK-OBJ_NAME = 'PICTURE'.
*OBJPACK-OBJ_DESCR = 'Representation of object 138'.
*OBJPACK-DOC_SIZE = TAB_LINES * 255.
*APPEND OBJPACK.
Completing the recipient list
RECLIST-RECEIVER = '[email protected]'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
*RECLIST-RECEIVER = 'SAPUSERNAME'.
*RECLIST-REC_TYPE = 'P'.
*APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT RECLIST.
WRITE: / RECLIST-RECEIVER(48), ':'.
IF RECLIST-RETRN_CODE = 0.
WRITE 'The document was sent'.
ELSE.
WRITE 'The document could not be sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'No authorization for sending to the specified number',
'of recipients'.
WHEN 2.
WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
WRITE: / 'No send authorization'.
WHEN OTHERS.
WRITE: / 'Error occurred while sending'.
ENDCASE.
Reward points if this helps.
Manish
Message was edited by:
Manish Kumar
Message was edited by:
Manish Kumar -
How to have rownum in a report based on a view
How to use rownum in a report or tabular form?
I wanted to number the rows in a report. The most obvious way would be just stick
rownum in there. There is a view in a database1. It is merely select a,b,c from various
things joined together and order by pkey1.
Apex is in database2 so I have to create a view there across the link
like:
create or replace view SOME_VIEW as
select * from OTHER_VIEW@SOMELINK
alter view SOME_VIEW add constraint PK_SOME_VIEW
PRIMARY KEY (pkey1)
DISABLE NOVALIDATE;
The problem is if I try to include rownum in the query in the report I always get:
failed to parse SQL query:
ORA-01446: cannot select ROWID from, or sample, a view with DISTINCT, GROUP BY, etc.
There's no rowid, it knows that the primary key is Pkey1 so what is the problem?
I know it's rownum that it hates. Maybe I can just number these things some other
way. However it'd be good to figure out what it is griping about.
Anyone know?
Edited by: lake on Mar 12, 2011 9:36 AMthanks!
Actually I made a mistake in testing. And it does work to do this:
in database1:
create or replace view VIEW1 as
select
rownum "SEQ", etc.
in database2:
create view VIEW2 as select * from VIEW1@mylink
How I screwed up testing that I don't know. I was calling the column NUM before....
this is good because you can create a report about the next so many of something, such as how many of
the next batch of mailings have address problems? For that you need to know in what order it will be done and
when to quit.
But I'm sure I will use the report rownum thing also. thanks very much. -
How to display the Standard Text (SO10) based on condition in adobe forms
Hi,
I have created the Standard texts (through SO10 tr.code) of 4 plant addresses. In the Layout of adobe form, i want to display any one plant address based on the plant number (as a input) and the rest 3 standard text need to be hide. i tried in Form clac to hide, but i unable to succeed. could you please help me, in this regard.
Thank you.
Regards,
MallikarjunaHi,
You can add all the 4 text in your context menu and create an condition for text.
Example: (LS_HEADER is a structure only for example, you need to decide based on your own form interface)
Text_1000 Condition -> LS_HEADER-WERKS = 1000
Text_2000 Condition -> LS_HEADER-WERKS = 2000
Text_3000 Condition -> LS_HEADER-WERKS = 3000
Text_4000 Condition -> LS_HEADER-WERKS = 4000
The text satisfyling your condition will only be printed and you can assign these text to the same block in PDF form. -
How to display the drill through report in a new browser seperate window
Hello All,
I am working on a drill through report which should run when I select the column value from the main report. The drill through report I am working on is Centerline Validate Angles for a specific line. It has 2 parameters, Pods ID and Angle. Main report supplies
these 2 values. Right now, I am having an issue in displaying the drill through report in a seperate window. I have selected Go To URL option from the text box properties in main report and gave the expression as
="javascript:void(window.open('http://vmaidbdev1/Reportserver?%2fADN2%2fPipeline%2fCenterline+Validate+Angles+For+Specifi+Line&rs%3aCommand=Render&PODS_ID="&Fields!LINE_ID.Value &"&Angle="&Parameters!Angle.Value
This is not working. The field in the main report is clickable but when I click it is throwing me error as Reporting services error. Could any one let me know if there is any error in the above expression or anything I need to add or correct.
Please help. Thanks so much.Hi srisql,
Sorry for the delay in getting back to you.
After double-check the URL which I posted, I find that I have made some error in it. As you can see, there are some spaces in the URL. So please try the following expressions to check the issue again.
Angle parameter is a multi-value parameter:
="javascript:void(window.open('http://vmaidbdev1/reportserver?/Adn2/Pipeline/Centerline Validate Angles for a specific line&PODS_ID="& Fields!LINE_ID.Value &"&Angle="
&Join(Parameters!Angle.Value,"& Angle =") &"','_blank'))"
Angle parameter is a single-value parameter:
="javascript:void(window.open('http://vmaidbdev1/reportserver?/Adn2/Pipeline/Centerline Validate Angles for a specific line&PODS_ID="&Fields!LINE_ID.Value &"&Angle="&Parameters!Angle.Value
&"','_blank'))"
The following general URL is for your reference:
="javascript:void(window.open('http://server_name/reportserver?/folder/ folder/report_name¶meter_name="&Fields!field_name.Value &"¶meter_name="&Parameters!parameter_name.Value
&"','_blank'))"
If you have any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to select records from Interactive Reports based on checkboxes
Referring to the link below
http://apex.oracle.com/pls/otn/f?p=31517:95
I want to select rows from the Interactve Report based on a checkbox. This demo page has 2 sections, one for classic report and other for interactive one. The classic report is able to select the whole records but the interactive report selects only the emp nos. I am looking for a functionality where I can select the whole record from the interactive report.
Any pointers will be helpful.
ThanksThat is easy. You should just modify the query:
DECLARE
v_count INTEGER := 0;
BEGIN
:p95_text_ir := NULL;
FOR i IN 1 .. apex_application.g_f20.COUNT
LOOP
v_count := v_count + 1;
FOR c IN (SELECT ename, job, mgr, sal, deptno
FROM emp
WHERE empno = apex_application.g_f20 (i))
LOOP
:p95_text_ir :=
:p95_text_ir
|| 'ID: '
|| c.empno
|| ' / '
|| 'Name: '
|| c.ename
|| ' / '
|| 'Job: '
|| c.job
|| ' / '
|| 'Manager: '
|| c.mgr
|| ' / '
|| 'Salary: '
|| c.sal
|| ' / '
|| 'Department: '
|| c.deptno
|| CHR (10);
END LOOP;
END LOOP;
:p95_text_ir := :p95_text_ir || ' / Records selected: ' || v_count;
END;Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
VAT REPORT BASED ON CURRENT LOGGED IN USER
Hi Guys,
I am Working for a client and it they are having 9 branches and for each branch there will be divided by different Series and different Tax Codes and they want a TAX Report based on the User Logged in.Each User Will be Assigned a branch and in the tax code an UDF(Location) has been created and for each tax code location has been entered there.
So when User 1 of Branch 1 is running the report then the report should show only the record of that particular Branch 1 and
When User 2 of Branch 2 is running the Report then it should show only branch 2 records .
I Tired using an FMS to record the Current User Logged in but i am unable to include this in the below query.
SELECT T0.U_NAME FROM OUSR T0 WHERE INTERNAL_K = $[USER]
In the Below query , the Report needs to be filtered automatically based on the Current user Logged in(User who is running the report).
There will be different Branches and Each Branch has One O Two Licenses and whenever the User1 Of Branch 1 runs the report then the report should display only the record related to that particular branch within the given date range.
So ,to differentiate the Tax codes for each Branches we have created an UDF(Location) in tax codes and enter the branch name in the UDF and also each branch will have 3 different document series and each series.
Instead of Giving the Location as a Parameter to choose we need to filter the report by the User logged in .
SELECT distinct M.DocNum AS 'AR Inv. #', M.DocDate as 'Date',
l.targettype AS 'TARGET TYPE',
t4.series,T4.SeriesName,
case when T4.SeriesName='LOC/HOF' then 'HEAD OFFICE'
when T4.SeriesName='LOC/CHN' then 'CHENNAI'
when t4.seriesName ='INS/CHN' THEN 'CHENNAI'
WHEN T4.SERIESNAME ='STF/CHN' THEN 'CHENNAI'
WHEN T4.SERIESNAME ='INS/HOF' THEN 'HEAD OFFICE'
end Location,L.TAXCODE,T6.RATE,
case when t.statype ='1' then 'VAT'
WHEN T.STATYPE ='4' THEN 'CST'
END TAXTYPE,T.STATYPE,
M.CARDCODE,M.CardName as 'Customer Name',M.NumAtCard as 'Bill No. & Dt.',M.DiscSum,M.RoundDif,
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',M.VATSUM,
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =1 ) as 'VAT SALES',
(SELECT SUM(TaxSum) FROM INV4 t where t.docentry=m.docentry and statype=1 ) as ' VAT COLLECTED ',
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =4 ) as 'CST SALES',
(SELECT SUM(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry ) as ' CST COLLECTED ',
(Select Sum(LineTotal) FROM INV3 Q Where Q.DocEntry=M.DocEntry) as 'FREIGHT',
M.DocTotal as 'Total (Rs.)'
FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry
LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
INNER JOIN NNM1 T4 ON M.SERIES=T4.SERIES
LEFT JOIN OSTC T6 ON T6.CODE= L.TAXCODE
LEFT JOIN OUBR T7 ON T7.NAME = T6.U_LOC
LEFT JOIN OUSR T8 ON T8.BRANCH = T7.CODE
WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
AND TARGETTYPE !='14' and taxrate !='0' A
ND T6.RATE != '0'
and t6.u_loc ='[%2]'
GROUP BY
M.DocNum,M.DocDate,M.CARDCODE,M.CardName,M.NumAtCard,M.DocEntry,
M.DiscSum,M.WTSum,
M.DocTotal,M.Series,T4.SeriesName,
T4.REMARK,M.RoundDif,M.VATSUM,T.STATYPE,T.TAXRATE,Q.LINETOTAL,t4.series,
l.targettype,t.docentry,L.TAXCODE,T6.RATE
Pls Gimme Some Ideas guys for designing this report .
Thanks And Regards,
P.VHai Gordon,
Thanks for the suggestion but i am sorry to say that after adding the said Condition to the below query it is showing the Below error.
QUERY :
SELECT distinct M.DocNum AS 'AR Inv. #', M.DocDate as 'Date',
l.targettype AS 'TARGET TYPE',
t4.series,T4.SeriesName,
case when T4.SeriesName='LOC/HOF' then 'HEAD OFFICE'
when T4.SeriesName='LOC/CHN' then 'CHENNAI'
when t4.seriesName ='INS/CHN' THEN 'CHENNAI'
WHEN T4.SERIESNAME ='STF/CHN' THEN 'CHENNAI'
WHEN T4.SERIESNAME ='INS/HOF' THEN 'HEAD OFFICE'
end Location,L.TAXCODE,T6.RATE,
case when t.statype ='1' then 'VAT'
WHEN T.STATYPE ='4' THEN 'CST'
END TAXTYPE,T.STATYPE,
M.CARDCODE,M.CardName as 'Customer Name',M.NumAtCard as 'Bill No. & Dt.',M.DiscSum,M.RoundDif,
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',M.VATSUM,
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =1 ) as 'VAT SALES',
(SELECT SUM(TaxSum) FROM INV4 t where t.docentry=m.docentry and statype=1 ) as ' VAT COLLECTED ',
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry and statype =4 ) as 'CST SALES',
(SELECT SUM(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry ) as ' CST COLLECTED ',
(Select Sum(LineTotal) FROM INV3 Q Where Q.DocEntry=M.DocEntry) as 'FREIGHT',
M.DocTotal as 'Total (Rs.)'
FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry
LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
INNER JOIN NNM1 T4 ON M.SERIES=T4.SERIES
LEFT JOIN OSTC T6 ON T6.CODE= L.TAXCODE
LEFT JOIN OUBR T7 ON T7.NAME = T6.U_LOC
LEFT JOIN OUSR T8 ON T8.BRANCH = T7.CODE
WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
AND TARGETTYPE !='14' and taxrate !='0' AND T6.RATE != '0'
AND $[USER] in (SELECT USERID FROM OUSR WHERE BRANCH = T7.CODE)
GROUP BY
M.DocNum,M.DocDate,M.CARDCODE,M.CardName,M.NumAtCard,M.DocEntry,
M.DiscSum,M.WTSum,
M.DocTotal,M.Series,T4.SeriesName,
T4.REMARK,M.RoundDif,M.VATSUM,T.STATYPE,T.TAXRATE,Q.LINETOTAL,t4.series,
l.targettype,t.docentry,L.TAXCODE,T6.RATE
ERROR
1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near 'USER'.
2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'GROUP'.
3). [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement 'User-Defined Values' (CSHS) (s) could not be prepared.
Regards,
P.V
Maybe you are looking for
-
How do I calculate averages in a form?
Hi All, I'm throwing myself on the mercy of the forum. I'm new to form building and I don't know javascript. I'm working on a form and I can't seem to get it right. When I first enter values it seems to be working, but if I make corrections or change
-
I was using itunes today and left the room for five minutes and came back. Now my ipod touch will not show up on my itunes and i can not download anymore songs. i had downloaded 31 songs today. is that why?
-
Can I have separate mail icons for my email accounts?
Is it possible to have separate email icons on my main screen - one for my personal account and one for my work account?
-
hi all i want to set current date to my databse from my JSP page i m using java.sql.Date d = (java.sql.Date) new java.util.Date();its not showing error in netbeans bt,grenerates casting exception: can not cast java.util.date to java.sql.Date How to d
-
Round tripping PSD in Cp7/TCS5???
I'm also continually challenged with round-tripping PSD files in Captivate. I can import a PSD layer, but I can't update the PSD from Cp if the original changes. So I figured that after editing the PSD file I would just import the PSD layer again. Bu