473,324 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

i am not getting correct return values :cp_4,plz help me

Expand|Select|Wrap|Line Numbers
  1. function CF_3Formula return Number is
  2. begin
  3.   IF :DLY_TYPE='BEFORETIME'  THEN
  4.       SELECT COUNT(:DLY_TYPE)INTO :CP_1 FROM TEMP_CNS_999           
  5.       WHERE :DLY_TYPE='BEFORETIME';
  6.       RETURN :CP_1;
  7.   ELSIF :DLY_TYPE='DELAY' THEN
  8.      SELECT COUNT(:DLY_TYPE)INTO :CP_2 FROM TEMP_CNS_999  
  9.      WHERE :DLY_TYPE='DELAY';
  10.      RETURN :CP_2;
  11.   ELSIF :DLY_TYPE='ONTIME' THEN
  12.      SELECT COUNT(:DLY_TYPE)INTO :CP_3 FROM TEMP_CNS_999 
  13.      WHERE :DLY_TYPE='ONTIME'; 
  14.      RETURN :CP_3;
  15.   ELSE
  16.       SELECT COUNT(:DLY_TYPE)INTO :CP_1 FROM TEMP_CNS_999 
  17.       WHERE :DLY_TYPE='BEFORETIME';
  18.                     --RETURN :CP_1;
  19.       SELECT COUNT(:DLY_TYPE)INTO :CP_2 FROM TEMP_CNS_999 
  20.       WHERE :DLY_TYPE='DELAY';
  21.                       --RETURN :CP_2;
  22.       SELECT COUNT(:DLY_TYPE)INTO :CP_3 FROM TEMP_CNS_999  
  23.       WHERE :DLY_TYPE='ONTIME'; 
  24.                      --RETURN :CP_3;
  25.       :CP_4 := :CP_1 || :CP_2 || :CP_3;
  26.         RETURN :CP_4;     
  27.   END IF;
  28.  
  29. end;
Jan 28 '08 #1
12 1818
debasisdas
8,127 Expert 4TB
From your code i am not sure what are you doing , and what are you passing to the function. Are you passing a field name ?
Jan 28 '08 #2
amitpatel66
2,367 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. function CF_3Formula return Number is
  2. begin
  3.   IF :DLY_TYPE='BEFORETIME'  THEN
  4.       SELECT COUNT(:DLY_TYPE)INTO :CP_1 FROM TEMP_CNS_999           
  5.       WHERE :DLY_TYPE='BEFORETIME';
  6.       RETURN :CP_1;
  7.   ELSIF :DLY_TYPE='DELAY' THEN
  8.      SELECT COUNT(:DLY_TYPE)INTO :CP_2 FROM TEMP_CNS_999  
  9.      WHERE :DLY_TYPE='DELAY';
  10.      RETURN :CP_2;
  11.   ELSIF :DLY_TYPE='ONTIME' THEN
  12.      SELECT COUNT(:DLY_TYPE)INTO :CP_3 FROM TEMP_CNS_999 
  13.      WHERE :DLY_TYPE='ONTIME'; 
  14.      RETURN :CP_3;
  15.   ELSE
  16.       SELECT COUNT(:DLY_TYPE)INTO :CP_1 FROM TEMP_CNS_999 
  17.       WHERE :DLY_TYPE='BEFORETIME';
  18.                     --RETURN :CP_1;
  19.       SELECT COUNT(:DLY_TYPE)INTO :CP_2 FROM TEMP_CNS_999 
  20.       WHERE :DLY_TYPE='DELAY';
  21.                       --RETURN :CP_2;
  22.       SELECT COUNT(:DLY_TYPE)INTO :CP_3 FROM TEMP_CNS_999  
  23.       WHERE :DLY_TYPE='ONTIME'; 
  24.                      --RETURN :CP_3;
  25.       :CP_4 := :CP_1 || :CP_2 || :CP_3;
  26.         RETURN :CP_4;     
  27.   END IF;
  28.  
  29. end;
Check for the values assigned to cp_1,cp_2 and cp_3 are they correct?
Use SRW.MESSAGE for printing the values of CP_1,2,3 as an alert during run time of the report and post back if the values of cp_1,2,3 ARE correct??
Jan 28 '08 #3
From your code i am not sure what are you doing , and what are you passing to the function. Are you passing a field name ?
:CP_1,2,3,4 IS PLACE HOLDER COULMN WHICH GETTING THE VALUES
OF DATA BASE COLUMN DLY_TYPE, CATAGORIES WISE. I WANT TO MERGE CP_1,2,3 INTO CP_4
Jan 29 '08 #4
Check for the values assigned to cp_1,cp_2 and cp_3 are they correct?
Use SRW.MESSAGE for printing the values of CP_1,2,3 as an alert during run time of the report and post back if the values of cp_1,2,3 ARE correct??
VALUES ARE GOING CORRECTLY INTO CP_1,2,3 BUT NOT IN CP_4.
I WILL TRY SRW.MESSAGE
Jan 29 '08 #5
debasisdas
8,127 Expert 4TB
VALUES ARE GOING CORRECTLY INTO CP_1,2,3 BUT NOT IN CP_4.
I WILL TRY SRW.MESSAGE
is CP_4 a number or string ?
Jan 29 '08 #6
:cp_4 is number.........................
Feb 1 '08 #7
debasisdas
8,127 Expert 4TB
:cp_4 is number.........................
then how can you use string concadination to store value in a number variable .
Feb 1 '08 #8
amitpatel66
2,367 Expert 2GB
:cp_4 is number.........................
Could you please provide some sample data that is getting assigned to CP_1,CP_2 and CP_3 and what exactly CP_4 is returning for those values?
Feb 1 '08 #9
i am using count( ) function. and counted values are going to :cp_4 and
:cp_1,2,3 all are number data type
Feb 2 '08 #10
amitpatel66
2,367 Expert 2GB
i am using count( ) function. and counted values are going to :cp_4 and
:cp_1,2,3 all are number data type
Hi Subash,

Please try resetting the values of CP_1,2,3,4 before assigning new values to them and check if CP_4 returns correct value?

And the way to are concatenating the values of CP_1,CP_2 and CP_3 is how you actually require?
Feb 2 '08 #11
simply concatenation and then i will go for addition
Feb 4 '08 #12
amitpatel66
2,367 Expert 2GB
simply concatenation and then i will go for addition
Did you try resetting the values to the CP_1,2,3,4 and then assign new ones??
Feb 4 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bhavin G | last post by:
Hi there , I am pretty new at javascripting and i am having this huge problem. I am using asp.net and C# webapplication. In my asp.net aspx file I have a place holder for taking an html table...
1
by: WIWA | last post by:
Hello, I have written a program that gets information from Active Directory. This is the function I'm using: void ADSysGetUserName(IADsADSystemInfo * pSys, char * data) { HRESULT hr; BSTR...
1
by: Martin | last post by:
There seems to be some strange behaviour when trying to get the scrollHeight and scrollTop of an iframe in IE6. I have tried several ways of getting these values when the iframe is written into...
6
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a...
36
by: Chuck Faranda | last post by:
I'm trying to debug my first C program (firmware for PIC MCU). The problem is getting serial data back from my device. My get commands have to be sent twice for the PIC to respond properly with...
2
by: rohitchawla | last post by:
have a problem with this code when working in IE it gives me 0,0 coords when i use iframe tag but gives correct coords when using firefox function GetRealOffset(id) { var elem =...
6
by: chris.kemmerer | last post by:
I am having a problem with templates and I hope someone here can help. I am writing a library that accepts data packets, parses them and saves the information for later use. One member of the...
5
by: dgleeson3 | last post by:
Hello all I have used the LoginForm1 class in a Visual studio 2005 VB application. Its the standard Username, Pasword request for user input. I was hoping to use property procedures to get...
9
by: KDawg44 | last post by:
Hi, I have PHP function that adds a record to the database. The table has an ID that is AUTO_INCREMENT. Is there anyway to get that ID back when I do any kind of insert? That ID is a foreign...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.