BMM Join logic needed
Hi,
In my BMM, I have two dimension tables(Plan Dim, Stage Dim) and one fact table(Combine fact).
Currently I have all my joins to be an inner join, in the source of my fact. (which is producing wrong results).
This is what I am trying to accomplish. When I pull columns from Plan Dim and Combine Fact for my report the query should not include Stage Dim tables at all, how can that be done.
Thanks for the help and your time.
It has both LTS in fact means you can take any column from both dimensions with the fact table column.....i suppose both are inner joined right.
Information :- http://peoplesoftbits.wordpress.com/2009/02/26/obiee-logical-table-vs-logical-table-sources-best-practice/
hi iam very new to OBIEE
If you dont want that scenerio just go to properties and remove the dimension table your not interested in.
Cheers,
KK
Similar Messages
-
Possible to embed join logic in metadata somewhere?
Do you know if Oracle Reports and Discovery allow us to create a schema for the end users to use so that they are not wandering around through the whole database when attempting to make reports? I am trying to figure out if we can embed some join logic in metadata some where so that creating reports is simplified and errors are reduced.
The problem is that we have foreign key that isnt unique, for the join to work you need to specify additional join criteria. For example to get additional data from table b, I have a portion of the foreign key in table a (column code) , but the other part is hard coded to make the join unique. select . where a.code = b.code and b.id = GENDER. Can I store this join criteria somewhere so that users can just use the join and they dont need to code this properly?Hi Steve,
Not sure if this will solve your problem completely, but just a thought:
1. Use a query like this:
select * from abc &where_clause
So you are using a user parameter (lexical reference) in your query in every report. Now suppose you have created your where clause (the actual text) and stored in some table in the DB.
2. You can use a "before report trigger" in every report that picks up this where clause from the DB, and populates the user parameter with it.
You can perform both these steps in your report template, so that the report developers can just apply this template to get the user param as well as the trigger.
Hope this helps.
Navneet. -
Why does logic need to be "warmed up"?
Whenever I start logic pro 7.1.1 and load up my most recent song, I always have to go through a series of core overloads. Most of my softsynths ( I typically use around 25 ) are EXS24 samples, and it seems as though whenever I load up an instrument I have a huge spike in CPU when a new note is played for the first time, and then it plays fine after that. The problem is when I load up a song and press play, I have to go through an annoying and tedious series of core overloads every time a new note is played until logic cashes all of the notes and I can actualy get to work. Is there any settings that I should change so logic will play the song the first time?
My core audio settings
256mb buffer
larger disk buffer
medium process buffer range
power book g4 1.5ghz 512mb ram logic 7.1.1 pro512mb ram
That's problem #1
larger disk buffer
Not a good idea, in view of your low RAM.
Are you using an external drive for your projects?
Having said that, I know this has been mentioned here before, so you might want to search for EXS24+missing notes. I think it was iSchwartz that had a theory about this - but I know that even with plenty of memory it seems that Logic needs its pump primed sometimes. -
Things that Logic needs to be #1!!!!
I think Logic needs to do some work on the waveform edit.
More like Pro Tools.
Right now, the main thing i miss is not to be able to quantize an Apple Loop. I mean, some parts of the loop that are offbeat are impossible to quantize.
Message was edited by: Bob AntisYes,i mean the blue apple loops.
I wouldn't even mind if i could tweak the normal aiff loops like Ableton Live or Pro Tools, to be able to quantize by yourself with precision!
I think Apple should include that in their next update, it's so important for waveform editing. My self, i edit a loop in Pro Tools,then export it and work it in Logic, it's so frustrating!!! -
I'm having difficulty with the join logic of a particular query, which is modeled with the following (highly simplified) schema:
create table a(
a_id number,
constraint pk_a primary key(a_id));
create table b(
b_id number,
a_id number,
constraint pk_b primary key(b_id),
constraint fk_b_a foreign key(a_id) references a(a_id));
create table c(
c_id number,
b_id number,
constraint pk_c primary key(c_id),
constraint fk_c_b foreign key(b_id) references b(b_id));
insert into a values(1);
insert into a values(2);
insert into b values(1,1);
insert into b values(2,1);
insert into b values(3,2);
insert into b values(4,2);
insert into c values(1,1);
insert into c values(2,2);
insert into c values(3,3);There can be 1-many "b" records associated with each "a" record, but "b" and "c" have a 1-1 relationship. What query will select only the "a" records that have ALL associated "b" records contained in "c"? Given the above data, the query should return only "a=1", since both "b=1" and "b=2" are contained in "c". However, it would NOT return "a=2", since both "b=3" and "b=4" are not contained in "c". The results should be:
OUTPUT:
a_id
1Hi,
Here's one way:
SELECT a.a_id
FROM a
JOIN b ON a.a_id = b.a_id
LEFT OUTER JOIN c ON b.b_id = c.b_id
GROUP BY a.a_id
HAVING COUNT (b.b_id) = COUNT (c.b_id)
;Most things that you can do with IN sub-queries can also be done with joins, or with EXISTS sub-queries. (Most things that can be done with EXISTS sub-queries can also be done wioth joins or IN sub-queries. However, there are lots of things that can be done only with joins.)
If you don't like one, try the others.
Thanks for posting the CREATE TABLE and INSERT statements; that's very helpful.
Don't forget to post the results you want from that data, no matter how simple those results are, and your version of Oracle. -
Need help in OBIEE BMM layer logic implementation
Hi All,
I have a requirement in my RPD development.
I have two tables account and site.
Table_Name:*Account*
Column_Name:
AccountID Store_Name Site Data_1_Name Site_Data_2_Name Site_Data_3_Name
264364 Wegmans_ Food_Markets GSF Floor_Type BSC
999999 Walmart Floor_Type BSC
999998 Walgreens BSC Avg_Cust_Count GSF
Table_Name:*Site*
Column_Name:
Site_ID Store_Name Account_ID Account_Name Site_Name Site Data_1_Value Site Data_2_Value Site Data_3_Value
264367 Wegmans_Food_Markets 264364 Wegmans_Food_Markets Alberta_Drive_#82 96114 Vinyl Kellermeyer
264368 Wegmans_Food_Markets 264364 Wegmans_Food_Markets Alberta_Drive_#83 96109 Poly_Vinly ABC
123 Walmart 999999 Walmart Alberta_Drive#1000 Vinly XYZ
1678 Walgreens 999998 Walgreens Calgary_ Drive#9009 ABC 10000 56565
Site Logical/ Presentation Table in OBIEE
Site_ID Store_Name Account_ID Account_Name Site_Name GSF Floor_Type BSC
264367 Wegmans_Food_Markets 264364 Wegmans_Food_Markets Alberta_Drive_#82 96114 Vinyl Kellermeyer
264368 Wegmans_Food_Markets 264364 Wegmans_Food_Markets Alberta_Drive_#83 96109 Poly Vinly ABC
123 Walmart 999999 Walmart Alberta_Drive#1000 Vinly XYZ
1678 Walgreens 999998 Walgreens Calgary_ Drive#9009 56565 ABC
for account table we have the Site Data_1_Name ..Site Data_3_Name columns values which is the column name for the values in Site table(i.e the values in the columns "Site Data_1_Value..Site Data_1_Value") . this values change dynamically based on the column name(Site Data_1_Name ..Site Data_3_Name ) in Account Table . how do i map this column values in RPD level ? or do we have any logic to implement this. PLEASE HELP ME TO SOLVE THIS ...
Thanks in advance ,
Mohan ManoHI mohan the information you provided holding some sensitive data please delete some of them otherwise you might be in trouble.
Make join between the account_ID and the SITE_ID based on the inner join columns which match in both tables will retrieved in the report. If you want to see the null values as well you can use outer join.
Thanks,
chak -
The following code is an example of how to perform an outer join, in this case with ReportQuery (thanks Doug):
ExpressionBuilder eb = new ExpressionBuilder();
ReportQuery rq = new ReportQuery(Employee.class, eb);
rq.addAttribute("firstName");
rq.addAttribute("lastName");
rq.addAttribute("areaCode", eb.anyOfAllowingNone("phoneNumbers").get("areaCode"));
List<ReportQueryResult> results = (List<ReportQueryResult>) session.executeQuery(rq);My question is about the logic Toplink uses to generate the outer join statement with the "(+)" in the generated sql.
Does Toplink only generate the join statement if the same attribute is chosen in the select statement (in the above example "areaCode")?
Along the same line of questioning, does it matter which attribute was in the get() call? So, in the above example did it have to be areaCode, or could it have been any other attribute of phoneNumber, and it still would have performed the join?
In my case, because the selection attributes are built up dynamicly, should I add all attributes of my child class (my equivalent PhoneNumber class)?Thanks for your reply Doug.
One last question, hopefully.
I have a parent table with 2 child tables. When attempting an outer join with both, toplink does not attempt to outer join either. I understand why, sort of - as you get an error when attempting this in sqlplus with "(+)" syntax.
I understand that you can outer join > 1 other table to a parent with ansi sql syntax:
select dept.*,emp.*
from dept left outer join emp
on dept.deptno = emp.deptnoWill toplink allow > 1 child table outer join to a parent table? -
Fail safe logic needed for purchase order upload program
Hello all,
i am working on creating PO's by reading data from a text file. I need to implement fail safe logic in it, which is to make sure this program uploads all the records in the text file successfully. For example, i have 1000 records in my text file and while running the upload program if the program times out while creating the 500th PO or if SAP is down at that time, then we have 499 PO's created and 501 yet to be created. But if we run the same program again, we will generate duplicate PO's for 499 again. I want to avoid this kind of problem.
How do i implement this idea?
Kindly guide me on this.
Thanks.Ok ..
Then I would suggest you use Application Log to keep the success and error messages of PO processing.
You can check trsnaction SLG0 and create your own application log object.
Then you need to use FMs BAL_LOG_* to crate and add messages to it.
This way you will have a facility to check as which of your records are converted to PO for a run.
In case SAP gets down in between , still you can find the details using Xn SLG1 and then accordingly remove the records from your file which are already converted to PO.
Thanks,
Ram -
Logic needed to print blank line in alv report
hi experts,
can anyone please tell me the logic for this
i want to logic one is
1) in alv report contains
a set of data contains 100 (5 datas)
and a set of data contain 200(5 datas)
i want to have one coloum containing serial no
ex for 100 i want to move no '5' to one coloumn ,but it should display only ones not for all 5 records.
same for 200 also i want to move 7 to this ,it should b displayed ones
i used for at new command alos its not working
2)suppose for particular date, 200 related records is not there
it should conatin blank line,displaying 'NIL'.
SO THE OPT FROMAT MUST BE
MATNR DOCNO
100 1000
100 1000
100 "
100 "
100 "
200 2000
200 "
200 "
200 "
200 "
SUPPOSE 200 RECORD IS NOT THERE THE OPT SHLD B
100 1000
100 1000
200 NILArun,
1)
If you are using the function module REUSE_ALV_GRID_DISPLAY, then use the internal table it_sort with a row for the column where you want the suppression of repeated values.
2)
If you are using the function module REUSE_ALV_GRID_DISPLAY, then simply ensure that your internal table t_outtab has the rows that you need containing 'NIL'.
John -
Logic needed in selection screen
hi experts,
in a selection screen i have one field S_budat ( it contains the range ) the user enters the date in it .the problum is we need to check the following condition .
if sy-datum> s_budat+13 months if it is ok we need get the values from the archive db else r/3 data .but in the mean while we have to check residency limit ( for ex: the data is archived till 22-03-2007. but in the selection screen the user entered the range 20-2-2006 to 24-5-2007 this falls in the both .so for this how to write the logic .till 22-03-2007 we have to take the data from the archive DB after thatwe have to take online data )
points will be reworded.You can check whether the Achive date lies between the range.
If it does, then create 2 records in the select-option table
1) from s_budat-low to arcive date
2) from archive date to s_budat-high.
Now you can do 2 selects 1 on archived tables , other on R/3 data using these 2 date ranges.
For the 2nd select , you can use the "appending" addition in the select statement -
Soundtrack Pro making a LOT of files - used to working in Logic, need help
So I'm used to working with Logic Studio/7.2/etc, and it's my first foray into working with Soundtrack Pro at work. My questions are this: When I use the razorblade tool (since I can't find an equivalent to the split tool in logic) in soundtrack to cut up a sequence, it seems to be creating a LOT of extra files:
http://www.1217design.com/pics/stp_question.png is an example of what I mean. Is this supposed to happen? The recorded files themselves were done in FCP and sent to Soundtrack Pro via the Send to STP Multitrack session function.
What I'm trying to find out is: Is this supposed to be happening? How can I stop this from happening? Are all of these extra files necessary in order to export the final project? And what will happen if I delete them?
I just want to know because the folder is now 4.71gb for a 30 second audio file (the final aif export is roughly 30mb), and there's over 200 of these extra files that have been created in the process of working on this project.
If this is what is necessary to work in Final Cut then I won't be able to work with FCP due to size issues (which is a shame as I feel so much more comfortable working within that environment than I do working in FCP).
Thanks for the help in advance,
SeanSean A wrote:
By doing this, will it still create all of those extra files? That's what I'm trying to figure out. Is it just from the blade tool being used?
For all edits, yeah, baby, STP will generate more files than cows create methane.
First, I know what works for me, but I'm still learning, so I strongly encourage you to keep a COMPLETE BACKUP of all projects until you know your workflow. Also, you may have Preferences set up differently than I do, so you may not find the same paths as what I describe here.
When you have an audio file the way you want it, and you're confident that you won't need those edit files again (be SURE) Process > Flatten All Actions (or Audible Actions) and Save that audio file. Then -- as I understand it so far -- you can safely trash all the edits related to that file. (If you use Photoshop or similar visual programs, it's the same idea.)
During my first few weeks of intensive STP work, my drive grew more and more sluggish, for no reasons known to me. I saw disk space shrinking rapidly. Finally I figured it had to have something to do with STP, so I started searching and eventually I found my edits piling up in home/Documents/Soundtrack Pro Documents, especially (for me) in Edited Media. Since they all came from projects I'd finished and exported to AAC and MP3, I was comfortable trashing them all. Suddenly, whoa, I had an extra 12 GB of disk space available.
Just keep those edit files until you are CERTAIN that you know what you're doing and that you're DONE. Otherwise, when some project needs one precious little 3MB turn of a phrase, you may find yourself confronting suicidal or homicidal tendencies.
I welcome further clarification and/or correction from people who know more and can explain it better.
Best,
chuck -
Hi Experts
I am having a list of TAXCODES like.
"CA" "CC" "CD" "DA" "DE" "WS"
Now in purchase orders if i am having different line items having the above TAX CODES.
i need to pass a variable &XXX& which is having text to sap script form.
And if the Purchase order having line items which is having one of the taxcode above for one line item and the other line item having diifferent taxcode like V0 etc { for these case i dont need to send text data }
and if the PO having one tax code for all line items.{ i need to send the data }
how to achive this
i am trying in this way
SELECT ebeln
ebelp
mwskz "Tax code
FROM ekpo
INTO TABLE lt_ekpo
WHERE ebeln = v_ebeln
AND mwskz in r_mwskz
AND loekz = ''.
DESCRIBE TABLE lt_ekpo LINES lv_count.
lt_ekpo1[] = lt_ekpo[].
SORT lt_ekpo1 BY ebelp DESCENDING.
READ TABLE lt_ekpo1 INTO wa_ekpo INDEX 1.
v_ebelp1 = wa_ekpo-ebelp.
CLEAR wa_ekpo.
LOOP AT lt_ekpo INTO wa_ekpo.
IF sy-tabix = 1.
lv_taxcode = wa_ekpo-mwskz.
ELSE.
IF lv_taxcode NE wa_ekpo-mwskz.
lv_diff_tax = 'X'.
if lv_taxcode EQ 'CA' or lv_taxcode EQ 'CC' or lv_taxcode EQ 'CD' OR lv_taxcode EQ 'DA' OR lv_taxcode EQ 'DE' or lv_taxcode EQ 'WS'.
ELSE.
ENDIF.
ENDIF.
please provide the logic for the above case.
Edited by: suribabu124 on Apr 26, 2010 4:13 PMhi
this can be done using rages
Regards
Suresh -
Hi Friends,
I need logic (code for the following requirement.
1. Bank guarantees received are entered by F-57 transaction as a noted item in system and the following data will be captured in the respective field.
Document date: Bank Guarantee date
Posting date: Date of entry
Reference field: BG Number
Document header text: Bank guarantee type
Assignment: Bank name
Special G/L Assignment: Bank account number
Text: Bank address
Due date: Claim end date
2. Posting keys (BSEG-BSCHL) 39 & 29 are used in F-57 transaction with special G/L Indicator (BSEG-UMSKZ) at time of Entering statistical postings and Reversal respectively
3. Cross check the period of validity of bank guarantee by comparing the due date (BSEG-ZFBDT) at the time of entering statistical postings and Document date (BKPF-BLDAT) at the time of Reversal.
4. If the bank guarantee cancels or reversed before due date (BSEG-ZFBDT) cancellation date i.e. Document date of reversal is to be populated in the report and in other case the due date is to be populated in the report.
Selection screen has the fields
BKPF-BUKRS Mandatory
LFA1/BSEG-LIFNR Optional
BSEG-ZFBDT Optional
BKPF-BLADT Optional
The o/p structure has the following fields
BKPF-XBLNR BG NO(Reference)
BSEG-LIFNR Vendor code
LFA1-NAME1 Vendor Name
BKPF-BLDAT Start date(Document date)
BSEG-ZFBDT End date(Due date)
BSEG-WRBTR Amount
BKPF-WAERS Currency
BSEG-ZUONR Bank Name(Assignment)
BSEG-SGTXT Bank Address
BSEG-HZUON Account Number
BKPF-BKTXT BG Type
BSEG-ZFBDT Claim end dateHi,
define internal table
It_bseg with fields BURKS, BELNR,GJAHR, BUZEI and other field (look the output fields).
it_bkpf with fields BURKS, BELNR,GJAHR anmd other required fields.
it_lfa1 with fields LIFNR and NAME1.
NOw
SELECT BURKS, BELNR,GJAHR ,<other required fileds>
into table it_bkpf from BKPF
where BUKRS in/= <selectionscreen-burks>
and bladt in/= <selectionscreen--bladt>.
If it_bkpf[] is not initial.
select BURKS, BELNR,GJAHR, BUZEI and other fields
into table it_bseg from bseg
for all entries in it_bkpf
where burks = it_bkpf-burks
and belnr = it_bkpf-belnr
and gjahr = it_bkpf-gjahr
and ZFBDT in/= <selection screen ZFBDT>
endif.
Now
select lifnr name1 from lfa1 into it_lfa1
where lifnr in <selection scfreen lifnr>.
YOu have three tables now..
you can loop at 1st table get the output fields put in into work area
read 2nd table relevant to first one and then read IT_LFA1 table with lifnr same as lifnr in BSEG and fill the final internal table.
Any doubts in retrieving please feel free to post your question
rewards if useful,
regards,
nazeer
Message was edited by:
'Nazeer' -
Hi all,
I have a requirement regarding data processing in a internal table,
internal table consists of filelds Vendor,Material and Scheduling Dates and Total Qty.
Here i need to fill the field Total Quantity, individual addition of quanties of that material for a particular vendor .
Let us consider intitially my internal table consists of data like this with these fields.
Vendor , Material , qty(individual), Total qty , Schedule dates
v1 , m1 , 10
v1 , m1 , 10
v1 , m1 , 20
v1 , m2 , 5
v1 , m2 , 10
v2 , m2 , 20
v2 , m2 , 15
v2 , m3 , 20
v2 , m3 , 10
Initiall the total qty field is empty i need to fill tht field for the last item for a particular material Like M1
for vendor v1 and total qty of m2 for vendor v1, total qty of m1 for v2, total qty of m2 for v2 and so on.
Requied output should be like this.
Vendor , Material , qty(individual) Total qty Schedule dates
v1 , m1 , 10 , 0
v1 , m1 , 10 , 0
v1 , m1 , 20 , 40(101020)
v1 , m2 , 5 , 0
v1 , m2 , 10 , 15(5+10)
v2 , m2 , 20 , 0
v2 , m2 , 15 , 35(20+15)
v2 , m3 , 20 , 0
v2 , m3 , 10 , 30(20+10)
Here i made one thing , i calculated the total qty of material for particular vendor.
Like
Vendor Material Total Qty
v1 , m1 , 40
v1 , m2 , 15
v2 , m2 , 35
v2 , m3 , 30
Finally i need the logic by using Control Events(At New , At End of ) to adjust that total qty of a material for a particular vendor by Modifying the internal table.
i hope my problem is clear , pls let me know if any clarifications needed. and
code for the same .
Thannks in advance,
Niranjan.Hi,
Solution is here.
sort itab by vendor material.
field-symbols: <itab> like line of itab.
loop at itab assigning <itab>.
on change of vendor.
clear flag.
endon.
add <itab>-quanity to lw_quantiy.
*--here pdate internal table end of each similar kind of record
at end of.
flag = 'x'.
<itab>-totalqty = lw_quantiy.
clear lw_quantiy
endat.
*--rest of record update zero by checking flag
if flag is initial.
<itab>-totalqty = 0.
endif.
endloop.
close this thread if you got solution.
Regards,
Peranandam -
Hi All,
I am new to crystal and my sql.
l have 2 command objects in that i have a common column pos_no.Now i need to apply Fullouterjoin between pos_no,but in crystal we don,t have that option.
So i saw some threads that we need to apply leftouterjoin union rightouterjoin to get FOJ in db level ,i tried ,but i don't have much knowledge in my sql.So can any one please apply FOJ between Pos_no of these two queries.
Please help me i strucked here
1st Query:
select
MIN(till_close.start_transaction_id) AS start_trans_id,
MAX(till_close.end_transaction_id) AS end_trans_id,
pos_config.pos_no,
pos_config.name AS pos_name,
SUM(transaction_tender.amount) AS EodDeposit
FROM
till_close
LEFT OUTER JOIN employee ON (till_close.employee_id = employee.employee_id)
INNER JOIN pos_config ON (till_close.pos_config_id = pos_config.pos_config_id)
INNER JOIN transaction_tender ON (till_close.end_transaction_id = transaction_tender.transaction_id)
INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
WHERE
DATE_FORMAT(till_close.transaction_date,'%d/%m/%Y') = DATE_FORMAT(STR_TO_DATE(?,'%d/%m/%Y'),'%d/%m/%Y')
AND transaction_tender.media_type_id NOT IN (10000)
GROUP BY
pos_config.pos_no
ORDER BY
pos_config.pos_no
2nd Query:
select
pos_config.pos_no,
pos_config.name AS pos_name,
SUM(CASE WHEN transaction.transaction_type_id=7 AND ((SELECT COUNT(transaction_id) FROM transaction_tender WHERE transaction_id = transaction.transaction_id AND media_type_id IN (SELECT media_type_id FROM media_type WHERE tender_type_id=12) AND amount < 0 )>0) THEN 0
WHEN transaction_tender.balance < 0
THEN transaction_tender.amount
ELSE (transaction_tender.amount - transaction_tender.balance)
END) AS net
FROM
TRANSACTION
INNER JOIN transaction_tender ON (transaction.transaction_id = transaction_tender.transaction_id)
INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
INNER JOIN pos_config ON (transaction.pos_config_id = pos_config.pos_config_id)
WHERE
transaction.transaction_date = DATE_FORMAT(STR_TO_DATE(?, '%d/%m/%Y'), '%Y-%m-%d')
AND transaction.transaction_type_id IN (1,5,7)
AND transaction.transaction_status_id = 3
AND transaction.is_training_mode = 0
GROUP BY
pos_config.pos_nohi Divya,
i would definitely take the advice from the folks here on a rewrite of your commands into one command.
since you've got 2 commands that are bringing back different results you may wish to consider bringing back the results from the 2nd command via a sub-query.
the general idea of the query is below, but you'll need to consult your online help for your database and or your dba for the correct syntax for your situation.
notes:
1) the subselect is in the bold font and is defined as a result set in the join...again, please consult your database help or the appropriated forum for your database as your syntax may vary
2) the fields in the subquery are then referenced in the select clause using the TT alias assigned to the result set in the join
3) the full outer join i guessed that you wanted on the two pos_no fields
4) if you do try to do this method and are looking on your database forum, do a search on "subquery multiple columns"
cheers,
jamie
select
MIN(till_close.start_transaction_id) AS start_trans_id,
MAX(till_close.end_transaction_id) AS end_trans_id,
pos_config.pos_no AS PC_pos_no,
pos_config.name AS pos_name AS PC_pos_name,
SUM(transaction_tender.amount) AS EodDeposit,
TT.pos_no AS TT_pos_no,
TT.pos_name AS TT_pos_name,
TT.net
FROM
till_close
LEFT OUTER JOIN employee ON (till_close.employee_id = employee.employee_id)
INNER JOIN pos_config ON (till_close.pos_config_id = pos_config.pos_config_id)
INNER JOIN transaction_tender ON (till_close.end_transaction_id = transaction_tender.transaction_id)
INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
FULL OUTER JOIN
(select
pos_config.pos_no,
pos_config.pos_name,
SUM(CASE WHEN transaction.transaction_type_id=7 AND ((SELECT COUNT(transaction_id) FROM transaction_tender WHERE transaction_id = transaction.transaction_id AND media_type_id IN (SELECT media_type_id FROM media_type WHERE tender_type_id=12) AND amount < 0 )>0) THEN 0
WHEN transaction_tender.balance < 0
THEN transaction_tender.amount
ELSE (transaction_tender.amount - transaction_tender.balance)
END) AS net
FROM
TRANSACTION
INNER JOIN transaction_tender ON (transaction.transaction_id = transaction_tender.transaction_id)
INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
INNER JOIN pos_config ON (transaction.pos_config_id = pos_config.pos_config_id)
WHERE
transaction.transaction_date = DATE_FORMAT(STR_TO_DATE(?, '%d/%m/%Y'), '%Y-%m-%d')
AND transaction.transaction_type_id IN (1,5,7)
AND transaction.transaction_status_id = 3
AND transaction.is_training_mode = 0
GROUP BY
pos_config.pos_no) AS TT
ON TT.pos_no = pos_config.pos_no
WHERE
DATE_FORMAT(till_close.transaction_date,'%d/%m/%Y') = DATE_FORMAT(STR_TO_DATE(?,'%d/%m/%Y'),'%d/%m/%Y')
AND transaction_tender.media_type_id NOT IN (10000)
GROUP BY
pos_config.pos_no
ORDER BY
pos_config.pos_no
Maybe you are looking for
-
Please, please help! Photos in library disappearing before my eyes.
When I open up the iphoto library, my picture thumbnails disappear one after the next--from seemingly random places, though mostly on the right hand side)--before my eyes. My worry is that I am going to loose all my photos. History: I have never had
-
Hi, I am using Forms 9i Version 9.0.2.9.0 and Database Oracle 9i Enterprise Edition Release 9.0.1.1.1. Database and Developer are in the same computer (Windows XP Professional). Folders are ora90 and 9iDSHome respectively. OC4J is running properly. M
-
Premiere Pro CS4 Crashes every time I toggle to another application
Dell Latitude D630 laptop w/Windows 7 Ultimate 32 bit. Running Production Premium CS4. PPro runs great except that any time I click out of it, even for the simplest function, like adjusting volume from the taskbar, PPro crashes. I previously ran CS3
-
I recently downloaded Firefox and made it my default browser. Links I have in Excel and Word that used to open with a single click when IE was my default browser no longer work. When I switched my default browser back to IE the links work again.
-
Hi, friends: i've configured de WEBUTIL and i've used it within a form, but when i deploy the form Java console shows: JInitiator: Versión 1.3.1.9 Usar versión JRE 1.3.1.9 Java HotSpot(TM) Client VM Directorio local del usuario = C:\Documents and Set