Fill area between two lines
Hello again.
I made two lines with the arc tool, but how I can fill the area between the two lines red ?
http://s7.directupload.net/images/130830/mbqw2prt.png
Which version of Illustrator are you using?
In case it's a recent one take a look at Live Paint groups and the Shape Builder tool.
Similar Messages
-
Shortest distance between two line segments
Hi.
I am looking for the code of the "Shortest distance between two line segments". I would appreciate if anyone has and willing to share.
I can find some in the net but its in VB and i am not familiar with it.
THanks a lot.
regards,There are a couple of things that are not clear:
What determines the rotation speed and lenght of each stick at any given time?
What is the program allowed to do to prevent collision (change speed/direction, change radius, stop everything)
Since you want to prevent collision, you need a predictive algorithm. Once they overlap, the collision has already happened. Too late!
What information does your algorithm get (e.g. r1, r2, theta1, theta2, delta-thetat1, delta-theta2, etc.), i.e. does the program only get static information and need to construct the trajectory from sequential history data or does it get dynamic information about speed and direction?
The trivial answer would be to just keep r1+r2 < distance(P1,P2). This will prevent all "potential" collisions.
LabVIEW Champion . Do more with less code and in less time . -
Unable to find line break between two lines in attachment file.
Dear all I will be very great full if someone help me out,
I am trying to send mail through SMTP server with an attachment of oracle report, but I am unable to find line break between two lines, when I down load the attachment from mail and open attach.txt file by double click on it. Next line starts right after previous line ends, it should starts with new line.
In order to send an attachment file, I am reading source file line by line and put MIME protocol’s attachment instance, contain of source file is being properly written into target file if I open that attachment on cmd prompt.
Following code may help you to understand the case.
Thanks in advance.
My code is as follows:-
create or replace procedure bec_file_test
v_subject varchar2, -- Subject of the email
v_body varchar2, -- Body of the email
v_from VARCHAR2 default 'XYZ.com', -- sender mail id
v_to varchar2 default 'XYZ.com', -- Field To of the email
v_cc varchar2 default 'XYZ.com' -- cc address
) is
-- variable to hold the smtp server connection
v_smtp_connection utl_smtp.connection;
-- variable to hold the smtp host name
v_smtp_host varchar2(100) default 'mail.bec-group.com';
-- variable to hold the smtp port
v_smtp_port number default 25;
-- composite of {CR}{LF} caridge return and line feed.
CRLF varchar2(2):=CHR(13)||CHR(10);
cursor pr_rec is
select requisition_no,line_no,release_no,a.contract,
a.project_id,substr(a.activity_seq,1,11)ACT_SEQ,
substr(a.part_no,1,12)PART_NO,
substr(a.description,1,32)DESCRIPTION,
substr(a.Bal_qty,1,8) BAL_QTY,
substr(a.unit_meas,1,5)UOM,
a.wanted_receipt_date WAN_REC_DT,
a.latest_order_date LAT_ORD_DT
from bec_pr_line_rep a
where a.Bal_qty>0 and a.header_state not in 'Closed'
and upper(a.state1) like 'RELEASED' and a.contract not in ('U1ENG','ULENG','U1FND','U2FND')
and a.buyer_code='70306'
order by a.part_no;
begin
declare
fHandle UTL_FILE.FILE_TYPE;
v_msg_line varchar2(2000);
-- v_buffer varchar2(20000);
--ALTER SYSTEM SET utl_file_dir = 'D:\Database\temp'
--COMMENT='Temporary change on Dec 14'
--SCOPE=SPFILE;
SELECT name, value
FROM gv$parameter
WHERE name = 'utl_file_dir';
--drop directory my_directory
--CREATE or replace DIRECTORY my_directory AS 'D:\database\temp';
--GRANT read,write ON DIRECTORY my_directory TO PUBLIC;
begin ---writing data into a file.
fHandle := UTL_FILE.FOPEN('MY_DIRECTORY', 'pending_pr_summry.txt', 'w');
UTL_FILE.put_line(fHandle, ' Pending PR to process (detail report)');
UTL_FILE.put_line(fHandle,TO_CHAR(SYSDATE,'MM-DD-YY HH:MI:SS AM'));
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
UTL_FILE.put_line(fHandle, 'Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt' );
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
for pr_temp in pr_rec loop
begin
v_msg_line:=to_char(rpad(pr_temp.requisition_no,12,' ')||'|'||
lpad(pr_temp.line_no,3,' ')||'|'||
lpad(pr_temp.release_no,3,' ')||'|'||
rpad(pr_temp.contract,7,' ')||'|'||
lpad(nvl(pr_temp.project_id,' '),7,' ')||'|'||
lpad(nvl(pr_temp.act_seq,' '),12,' ')||'|'||
lpad(pr_temp.part_no,12,' ')||'|'||
rpad(pr_temp.description,35,' ')||'|'||
lpad(pr_temp.bal_qty,10,' ')||'|'||
rpad(pr_temp.uom,6,' ')||'|'||
lpad(pr_temp.wan_rec_dt,14,' ')||'|'||
lpad(pr_temp.lat_ord_dt,14,' '));
UTL_FILE.put_line(fHandle,v_msg_line);
end;
end loop;
UTL_FILE.put_line(fHandle, '--------------------------------------------------------------------------------------------------------------------------------------------------');
UTL_FILE.put_line(fHandle, ' Regards : IFSAPP ( Application owner ) ');
UTL_FILE.FCLOSE(fHandle); ------------writing into file is successfuly done here!
--Reading of file starts here containt will be added in attchment file
fHandle :=UTL_FILE.FOPEN('MY_DIRECTORY','pending_pr_summry.txt','R' );
-- establish the connection to the smtp server
v_smtp_connection := utl_smtp.open_connection(v_smtp_host, v_smtp_port); /** OPEN CONNECTION ON THE SERVER **/
-- perform a handshake with the smtp server
utl_smtp.helo(v_smtp_connection, v_smtp_host); /** DO THE INITIAL HAND SHAKE **/
-- set the 'from' address of the message
utl_smtp.mail(v_smtp_connection, v_from);
-- add the recipient to the message
utl_smtp.rcpt(v_smtp_connection, v_to);
-- send the email
utl_smtp.open_data(v_smtp_connection);
v_msg_line:='Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || CRLF ||
'From: ' || v_from || CRLF ||
'Subject: ' || v_subject || CRLF ||
'To: ' || v_to || CRLF ||
'Cc: ' || v_cc || CRLF ||
'MIME-Version: 1.0'|| CRLF || -- Use MIME mail standard
'Content-Type: multipart/mixed;'||CRLF ||
' boundary="-----SECBOUND"'||CRLF||
CRLF ||'-------SECBOUND'|| CRLF ||
'Content-Type: text/plain;'|| CRLF ||
'Content-Transfer_Encoding: 7bit'|| CRLF ||
CRLF ||v_body|| CRLF; -- Message body
utl_smtp.write_data(v_smtp_connection,v_msg_line);
v_msg_line:='-------SECBOUND'|| CRLF ||
'Content-Type: application/octet-stream;'|| CRLF ||
'Content-Type: text/plain;'|| CRLF ||
'name="pending_pr_summry.txt"'|| CRLF ||
'Content-Transfer_Encoding: 8bit'|| CRLF ||
'Content-Disposition: attachment;'|| CRLF ||
' filename="pending_pr_summry.txt"'|| CRLF || CRLF; -- Content of attachment
utl_smtp.write_data(v_smtp_connection,v_msg_line);
-- check file is opened
IF utl_file.is_open(fHandle) THEN
-- loop lines in the file
LOOP
BEGIN -- Content of attachment
utl_file.get_line(fHandle,v_msg_line);
v_msg_line:=concat(v_msg_line,CRLF);
utl_smtp.write_data(v_smtp_connection,v_msg_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
END LOOP;
END IF;
--end of attachment containt
utl_smtp.write_data(v_smtp_connection,v_msg_line);
UTL_FILE.FCLOSE(fHandle);
utl_smtp.close_data(v_smtp_connection);
utl_smtp.quit(v_smtp_connection);
exception
when utl_smtp.invalid_operation then
dbms_output.put_line(' Invalid Operation in Mail attempt using UTL_SMTP.');
when utl_smtp.transient_error then
dbms_output.put_line(' Temporary e-mail issue - try again');
when utl_smtp.permanent_error then
dbms_output.put_line(' Permanent Error Encountered.');
when others then
dbms_output.put_line('Exception: SQLCODE=' || SQLCODE || ' SQLERRM=' || SQLERRM);
RAISE;
end;
end bec_file_test;Pending PR to process (detail report)01-17-13 12:43:19 PM--------------------------------------------------------------------------------------------------------------------------------------------------Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt--------------------------------------------------------------------------------------------------------------------------------------------------MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade |500|kg |30-NOV-2012| 20-nov-2012MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012MAT/250606 | 2| |NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | |1|NMDCJ|6001|100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1|pkt | 25-DEC-2013| 14-dec-2013--------------------------------------------------------------------------------------------------------------------------------------------------
where as source file is like that:-
Pending PR to process (detail report)
01-17-13 12:43:19 PM
Req.no. li Re Site Prj Id Act seq Part no Description Qty UOM want rec dt lat ord dt
MAT/250370 | 2| 1|ISCSP | 4977| 100004207| 0104000016|Angle 50 X 50 X 6 IS:2062 Grade | 5500|kg | 30-NOV-2012| 20-nov-2012
MAT/250370 | 3| 1|ISCSP | 4977| 100004207| 0105000002|Channel 100 X 50 IS:2062 Grade A | 1000|kg | 30-NOV-2012| 20-nov-2012
MAT/250579 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 2991|kg | 13-DEC-2012| 03-dec-2012
MAT/250606 | 2| 1|NMDCJ | 6002| 100005860| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 2| 1|NMDCJ | 6001| 100005580| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 1500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 3| 1|NMDCJ | 6002| 100005818| 0109020002|TMT Bar 10 mm Fe 415 IS:1786 | 3939|kg | 29-DEC-2012| 19-dec-2012
MAT/250606 | 4| 1|NMDCJ | 6002| 100005860| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 39000|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 4| 1|NMDCJ | 6001| 100005580| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 2| 1|NMDCJ | 6002| 100005818| 0109020004|TMT Bar 16 mm Fe 415 IS:1786 | 12183|kg | 29-DEC-2012| 19-dec-2012
MAT/250606 | 6| 1|NMDCJ | 6002| 100005860| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 9500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 6| 1|NMDCJ | 6001| 100005580| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 4500|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 6| 1|NMDCJ | 6002| 100005818| 0109020006|TMT Bar 25 mm Fe 415 IS:1786 | 17500|kg | 29-DEC-2012| 19-dec-2012
MAT/250607 | 7| 1|NMDCJ | 6001| 100005580| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 22000|kg | 29-DEC-2012| 19-dec-2012
MAT/250194 | 7| 1|NMDCJ | 6002| 100005818| 0109020008|TMT Bar 32 mm Fe 415 IS:1786 | 27060|kg | 29-DEC-2012| 19-dec-2012
MAT/251138 | 1| 1|NMDCJ | 6002| 100005825| 3501000001|Cement 50 kg | 1 |pkt | 25-DEC-2013| 14-dec-2013
Ignore alignment. It is well formatted in source file. -
Spacing between two line types in smartform
I have data in two different line types as below
line type1
linetype2
but what my requirement is
line item1
line item2
i had tried by changing the smart style but it dint work. Please help me out in reducing the space between the datas of the line types.Hi
Go to your smartstyle.
Go to your paragran format.
Click on tab Indents and Spacing.There you will see a field named LINE SPACING.In that you can adjust the spacing between two lines.
Regards
Khushboo -
Why are there two lines showing when I switch off my iPad where the cancel word is?
Why are there two lines showing on my iPad when I turn it off where the cancel word is.
You wrote:
"I have noticed that on my IPad Calendar, that on some of the scheduled appointments it is showing Phoenix as a time zone. On some it is showing Salt Lake City, and then on others it will show Denver. I can't quite see why or understand why that this is an issue since everything is set to Salt Lake City. On the ones that show up with Phoenix as the time zone the times change. Also I have had some of the times showing on the calendar at an hour different that when I open the Appointment. It will show the correct time, but on the Calendar it is sometimes different. "
From that information, it makes sense that your calendar is off.
Phoenix is in another time zone part of the year. When daylight saving changed, Salt Lake City and Denver changed, but Phoenix did not. You may have set time and date to auto, but the Mac knows the time difference and is compensating for it. -
Can I switch my phone number between two lines(not just between phones)?
I have 4 months left on my current plan. I would like to take advantage of current holiday sales to get the droid razr for cheap. I am considering adding an additional line to my plan to get the upgrade. The problem with this is that I either have to use the new number and let my other contract end or continue on with my current number and pay for 2 lines for the next 2 years. I noticed that verizon lets you switch the phone number that is associated with your line. Would I be able to add an additional line to my plan and then switch the numbers between these two lines? Essential line A has number A and ends in 4 months, line B has number B and ends in 20 months, and I want to make it so that line B has number A and then only pay for line A for the next 4 months. Is this possible?
Verizon does not allow you to switch numbers since they are tied to your contact. However, there's a work around, because Verizon does allow you to port a number from another carrier to overwrite the existing number without changing your contract. So here's what you need to do:
1. Get the Razr cheap like you wanted on a secondary line;
2. Wait for 4 months so your main line contract is up;
3. Port out your main line number to another carrier, for example, Pageplus;
4. Wait till your bill cycle is passed and port that number from Pageplus to Verizon, overwrite the number on secondary line.
After step 4 you will have your main number back on the line with the Razr. -
How to Increase Line space between two lines in ALV Grid
hi,
I want to increase the line space between any two lines in ALV GRID. Can anybody has solution for this issue.
Regards,
MadanHi Madan
It's not possible
Regards
Gregory -
Anchor between two lines ?
Hi,
Use emp table for example.
If I need the report use form-like format, e.g, the fields show as below
b_empno f_empno b_ename f_ename
b_sal f_sal b_job f_job
where b_xxx is the text field, f_xxx is data field.
Now the question is, if the width of f_ename is not enough, it will warp to the 2nd line,
then the position of f_job is at 3rd line, as below
b_empno f_empno b_ename f_enamexxx
b_sal f_sal b_job f_enamexxx
f_job
This is not acceptable. How can I let the layout show as below which is what i want?
b_empno f_empno b_ename f_enamexxx
f_enamexxx
b_sal f_sal b_job f_job
It seems need an anchor between to 'lines'?
Please notice the restriction
1. There are the same record
2. Can not know which field is not long enough in the design time
Any suggestion?
Thanks in advance.
William
nullHi, William
The answer is to create a frame (not repeating, a simple frame) around EACH line of label+fields.
Using your example, it should be:
| _________________________________ |
| | | |
| = b_empno f_empno b_ename f_ename = |
| |_________________________________| |
V ________________________________ |
| | | |
| = b_sal f_sal b_job f_job = |
| |________________________________| |
|_______________________________________|Make the frames vertically expandable (vertical elasticity = expand)
No need to use anchors.
Hope this helps,
Pedro -
Swap phone number between two lines at same proper...
Hello,
I was hoping for some help in finding out if it is possible to switch our phone numbers around on our BT Business phone line to our BT Personal Phone line?
Thanks for any help/advice you can offer.seanuk wrote:
Hi Keith,
Thanks for your reply. The residential line is not used for business and both lines are in different parts of the home.
Cheers
It would be much cheaper to run your own internal extension wiring between the two rooms, and then swap them over yourself, provided you have the modern NTE with the removable faceplate on both lines.
Like this
I dread to think the sort of hassle you are going to get, trying to sort it out between BT Business and BT residential. No something for the faint hearted
There are some useful help pages here, for BT Broadband customers only, on my personal website.
BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones. -
How to fill areas between paths?
Hello,
Im new in Illustrator,
I don't need those white lines in the middle, so I would like to know how I can fill that shape fully with black color?
Thank you!Random Hero,
Always create and keep a copy of the original artwork before you start destroying it.
As I (mis)understand it, you may:
1) Select all the paths and change them to stroke/nofill so you can see what you are doing;
2) Click each of the corner Anchor Points on either side of each gap in the outer shape;
3) Delete all the paths that form no part of the outer shape;
4) Select the remaining paths and Ctrl/Cmd+J to join them into one path;
5) Switch back to fill/nostroke. -
SAP Script - delete paragraph between two lines or move address one line up
Hi all,
i have a problem concerning SAPscript and formating.
In the address window i have an include, which provides a text in a line. after that i have a command line with address and paragraph, which sorts and formats the address. Problem is that there is a gap between my Text from the Include and the address. Is there a way to move the address one line up or any other way to delete the paragraph there?
SAPscript looks like this:
include ....
endif.
adress paragraph zz
name Testname
street teststreet
Postalcode 98788
City Town
Print Form:
Text from the include
<----
how can I get rid of this empty line?
Testname
teststreet
98788 Town
Any Suggestions?
Thanks,
DenisHi there,
no results yet. nothing worked so far. What does PB mean?
The CODE looks as follows:
/: if ....
/: include ........ new-paragraph SA
/: endif
/: if ....... OR ....
/: address Paragraph AS
/: name ......
/: street ......
/: endaddress
Print::
Text blablabla
<---- empty line
Name .....
Street .....
The include has no empty line in the end.
I have no more clues how to delete the empty line in between the address and the include text.
regards,
denis -
Painting area between two nested arcs ?
Hi,
Is there anyone that can provide a solution for this problem ?
Can't use a loop drawing smaller arcs since I need to paint the area with a gradient.
I tried to append the inner arc to a GeneralPath derived from the outer arc but
It doesn't work.
This was my attempt :
Arc2D.Float arc2D = new Arc2D.Float(20.0f, 20.0f, 160.0f, 160.0f, 0.0f, 180.0f, Arc2D.CHORD);
GeneralPath generalPath = new GeneralPath(arc2D);
generalPath.setWindingRule(GeneralPath.WIND_EVEN_ODD);
arc2D.x += 20;
arc2D.y += 20;
arc2D.width -= 20 << 1;
arc2D.height -= 20 << 1;
generalPath.append(arc2D, true); // true or false
graphics2D.setPaint(gradient);
graphics2D.fill(generalPath);thanks in advance
LucioStupidity ? well yes
Here's the solution :
Arc2D.Float arc2D = new Arc2D.Float(20.0f, 20.0f, 160.0f, 160.0f, 0.0f, 180.0f, Arc2D.CHORD);
GeneralPath generalPath = new GeneralPath(arc2D);
generalPath.setWindingRule(GeneralPath.WIND_EVEN_ODD);
arc2D.x += 20;
arc2D.y += 10;
arc2D.width -= 20 << 1;
arc2D.height -= 20 << 1;
generalPath.append(arc2D, false);
graphics2D.setPaint(gradient);
graphics2D.fill(generalPath); -
Hello,
I'm using DIAdem 2011 SP1.
I have a diagram with a curve as "Filled area".
The curve parameters for the filled area are:
Line color: blue
Filling color: blue
Transparency: 90%
The transparency is needed, otherwise the grid is hidden by the filled area in the diagram.
DIAdem shows the report correctly, but in the exported PDF the area is blue without any transparency.
(The area was filled black in the PDF if DIAdem 2010 is used.)
(The report is printed correctly directly from DIAdem.)
Can someone help at this topic?
Solved!
Go to Solution.I have a script to build a collection of curves in REPORT. The script creates 3 lines per test (GROUP). They are an upper boundary, a lower boundary, and then a filled area between. The upper and lower boundary curves are of CURVE TYPE = LINE. The filled line is of CURVE TYPE = FILLED AREA. It works perfectly in creating these in REPORT. However, when I try to EXPORT, DiaDEM crashes. "Incorrect instructin or user command ....... Cannot open clipboard.).
I have read that there is an issue with exporting FILLED AREA from DiaDEM. I really need this to be availabe in some manner, so I wanted to know the status and/or other options for doing this.
I am using version 2010.
DIAdem: 11.2.0f4718 TDM
USI: 1.8.0f4177
DataFinder: 2.2.0f4177 -
Hello everybody,
Please advise me how to make a JTable ToolTip to be displayed in two lines
Thanks,
ElenaUse HTML tags to split tool tip text between two lines. For example:
JTable table = new JTable();
table.setToolTipText("<html>This table's tool tip text<br>is split between two lines</html>"); -
I can't really seem to get this straightened out.
SELECT distinct DATE, gross_total_return
FROM WPI_ICL
CASE Between '01-01-1980' AND '09-30-2008'
AND description = 'Broad Market Index United States Property (US Dollar)'
ELSE
description = 'S&P United States Property Residential (US Dollar)'
END
So, if records are between two dates, select a certain description, ELSE select a different description. I've tried IF...Then, and I've tried Case too. So far, nothing has worked out.
Can someone please give me a point in the right direction?
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.Here's a working example:
DECLARE @wpi_icl TABLE (date DATE, gross_total_return FLOAT, description1 VARCHAR(100), description2 VARCHAR(100))
INSERT INTO @wpi_icl (date, gross_total_return, description1, description2)
VALUES
('2008-09-29', 100.0, 'Broad Market Index United States Property (US Dollar)', 'S&P United States Property Residential (US Dollar)'),
('2008-10-01', 200.0, 'Broad Market Index United States Property (US Dollar)', 'S&P United States Property Residential (US Dollar)')
SELECT date, gross_total_return,
CASE WHEN date BETWEEN '1900-01-01' AND '2008-09-30' THEN description1
ELSE description2
END AS description
FROM @wpi_icl
From the code you posted, it seems you're unsure of the syntax of CASEs.
There are two ways to use a case. The first is the example above. You enclose the conditions between CASE and END.
Each condition has its own WHEN with a clause that evaluates to true or false. This clause can be made up of as many conditions as you like. After the clause comes a THEN. This is essentially what you want to happen if the clause returns true. WHEN/THEN is
synonymous with IF/THEN in this instance.
Including an ELSE is optional, but, be aware if you do not, and none of your WHEN clauses evaluate to true, you will have a NULL returned.
CASE
WHEN theseDriods = theDriodsWereLookingFor THEN callVader
WHEN theseDriods <> theDriodsWereLookingFor THEN moveAlong
ELSE goHomeAndRethinkLife
END
The other (less common) option operates like a SWITCH in some other languages. Its still surrounded by CASE and END but this time, the when just contains a value to be compared to the value at the start of the case:
CASE 16
WHEN 15 THEN 'too low'
WHEN 16 THEN 'just right'
WHEN 17 THEN 'too high'
END
Hope this helps.
Maybe you are looking for
-
Performance Issue Crystal Report and Oracle
Hello, We have one procedure that takes 3 input parameters and returns Cursor from Procedure that is used to design the report. There is no caluculation involved here and cursor is opended dynamically. We are using Oracle Native connection. When we c
-
Invalid identifier results from an sql statement in php
hello there, i'm trying to access data from an oracle 11g database via oci and php 5.3.8. i'm getting the ORA-00904 (invalid identifier) error when executing the following statement: $stid = oci_parse($conn, 'select * from table1 where column1 = "XYZ
-
Bridge Crashes On Every Metadata Updates - Updating Any Tag Or Metadata - CS6
Any ideas on how to resolve this issue?
-
I do not have Final Cut Pro X as of yet, but I'm wondering, I do have iDVD & can I use iDVD in the current version of Final Cut Pro X? If I have iDVD on my computer and also Final Cut Pro X on my computer will that appear in the share portion of Fina
-
Testing adobe air applications with fake apple certificate in iOS simulator running in a hackintosh
I can compile an Adobe Air application on windows with a fake apple certificate. Can I test this application in iOS Simulator running on a hackintosh? Or is the simulator blocking testing of IPA outside from XCode ie: it's not a standalone simulator