Hi
I need sum the month totals
SELECT region_name, area_name
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '07' THEN sales_target END) AS jul
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '08' THEN sales_target END) AS aug
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '09' THEN sales_target END) AS sep
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '10' THEN sales_target END) AS oct
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '11' THEN sales_target END) AS nov
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '12' THEN sales_target END) AS dec
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '01' THEN sales_target END) AS jan
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '02' THEN sales_target END) AS feb
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '03' THEN sales_target END) AS mar
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '04' THEN sales_target END) AS apr
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '05' THEN sales_target END) AS may
,SUM (CASE WHEN SUBSTR(yr_mth,5,2) = '06' THEN sales_target END) AS jun
FROM sales_forecast WHERE REGION_NAME like nvl('®IONNAME','%') AND
AREA_NAME like nvl('&AREANAME','%') AND
yr_mth=nvl('&Year',substr(yr_mth,1,4))||NVL(DECODE('&Month','JAN','01','FEB','02','MAR','03','APR','04','MAY','05',
'JUN','06','JUL','07','AUG','08','SEP','09','NOV','11','DEC','12'),substr(yr_mth,5,6))
GROUP BY region_name, area_name
ORDER BY region_name, area_name
Requirment
region_name, area_name, jul, aug ................ jun
abc xyz 10, 20.....................30
ccc ggg 20, 30.....................40
total 30, 50 ...................70
thanks
j1inmis Ouput layout changes
Hi,
How to secure my login data to my database?
Hi there,It may be a stupid question but I don't know how to secure my login data to my database. I have created an include file in order not to have these data in the code of my pages, but I don't
Are sessions secure at all?..
I haven't really gotten into yet, but I was just thinking of something weird..Lets say you have a session element $_SESSION['is_admin']..Is that easy to modify the cookie or whatnot and change it to
IS this code correct
The reason i ask is everything underneath it appears to be alink as well, tis blimmin annoyingCode: <?php echo '<li class="newproducts"><a
Entering Data Problem
Code: $result = mysql_query("SELECT * FROM flights");while ($row = mysql_fetch_array($result)){if ($flight_num == $row['flight_num']){echo "<center>Flight Number
mysql VARCHAR acting like INT
Hi, All.I have a table that contains a varchar(10) column named weird_field. In this column, only integers reside (e.g., 3010101009). When I do this:Line number On/Off | Expand/Contract select *
Word Trimming
Hi Guys & Gals!!Hope you are all ok....I need some help with the followingI need to trim the following word as follows:$word = 'James Bond';output would be 'James B'There is a space between
INSERT for date range
Hi allI have the following tableCode: [Select] `date` date `day` int(2) `month` int(2) `year` int(4)If I pass a date range in PHP, such asCode: [Select]$datefrom = '2009-02-20';$dateto =
XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, here's the XML<categories> <category id="12345">
dropdown box help - open php files to textarea
Hi, I am using tinymce to edit content located in several php files. The code I attached works but is missing some functionality and I am very new at php so I need some help or advise please.What I