Oracle 7.3 Date Query via Visual InterDev

Oracle 7.3 Date Query via Visual InterDev

Post by AShet » Sun, 31 Dec 1899 09:00:00



Hi all,
    I am trying to write a web query in Visual InterDev which will return a
subset of records based upon user input (ie. A user will select the date
range for which he would like to see employee records). I am trying create
the SQL statement which will prompt for the start date and end date for the
range using the following statement:

SELECT EMPAUX.SUPERNO, LABOUR_HISTORY.EMPLOYEENO,
    EMPLOYEES.SURNAME, EMPLOYEES.GIVEN_NAME,
    LABOUR_HISTORY.TIMEDATE,
    LABOUR_HISTORY.WORKORDERNO,
    SUM(LABOUR_HISTORY.HOURS_WORKED)
    AS SUMOFHOURS
FROM EMPAUX, EMPLOYEES, LABOUR_HISTORY
WHERE EMPAUX.EMPNO = EMPLOYEES.EMPLOYEENO AND
    EMPLOYEES.EMPLOYEENO = LABOUR_HISTORY.EMPLOYEENO
GROUP BY EMPAUX.SUPERNO, LABOUR_HISTORY.EMPLOYEENO,
    EMPLOYEES.SURNAME, EMPLOYEES.GIVEN_NAME,
    LABOUR_HISTORY.TIMEDATE,
    LABOUR_HISTORY.WORKORDERNO
HAVING (LABOUR_HISTORY.TIMEDATE >= TO_DATE(:FromDate:,
    'MM/DD/YY')) AND
    (LABOUR_HISTORY.TIMEDATE <= TO_DATE(:ToDate:,
    'MM/DD/YY'))
ORDER BY EMPAUX.SUPERNO, LABOUR_HISTORY.EMPLOYEENO,
    LABOUR_HISTORY.TIMEDATE

When I attempt to run this statement, I am prompted for the FromDate and
ToDate entries and I enter the correct format (10/25/99 and 10/31/99).

The response that I get back is ORA-01840 - Input value not long enough for
date format.

Is there anything that any of you can consider as being improper with the
way this statement is written?

Thanks in advance for all of your support.

Ashi Sheth
Applied Aerospace Structures Corp.

 
 
 

Oracle 7.3 Date Query via Visual InterDev

Post by G Jong Fon » Sun, 31 Dec 1899 09:00:00


Hello,

If FromDate and ToDate are DATE type, you need to do this:
TO_DATE(to_char(:FromDate:,'MM/DD/YY')).

If FormDate and ToDate are STRING type, you need to make sure they are
in 'MM/DD/YY' format (ie. "12/01/99").

Of course, after conversion, you will lose hours and minutes.
You might want to do this:

Quote:>= to_date(to_char(:FromDate:,'MM/DD/YY')) and

< to_date(to_char(:ToDate:,'MM/DD/YY')) + 1

Gook Luck

Jong



> Hi all,
>     I am trying to write a web query in Visual InterDev which will
return a
> subset of records based upon user input (ie. A user will select the
date
> range for which he would like to see employee records). I am trying
create
> the SQL statement which will prompt for the start date and end date
for the
> range using the following statement:

> SELECT EMPAUX.SUPERNO, LABOUR_HISTORY.EMPLOYEENO,
>     EMPLOYEES.SURNAME, EMPLOYEES.GIVEN_NAME,
>     LABOUR_HISTORY.TIMEDATE,
>     LABOUR_HISTORY.WORKORDERNO,
>     SUM(LABOUR_HISTORY.HOURS_WORKED)
>     AS SUMOFHOURS
> FROM EMPAUX, EMPLOYEES, LABOUR_HISTORY
> WHERE EMPAUX.EMPNO = EMPLOYEES.EMPLOYEENO AND
>     EMPLOYEES.EMPLOYEENO = LABOUR_HISTORY.EMPLOYEENO
> GROUP BY EMPAUX.SUPERNO, LABOUR_HISTORY.EMPLOYEENO,
>     EMPLOYEES.SURNAME, EMPLOYEES.GIVEN_NAME,
>     LABOUR_HISTORY.TIMEDATE,
>     LABOUR_HISTORY.WORKORDERNO
> HAVING (LABOUR_HISTORY.TIMEDATE >= TO_DATE(:FromDate:,
>     'MM/DD/YY')) AND
>     (LABOUR_HISTORY.TIMEDATE <= TO_DATE(:ToDate:,
>     'MM/DD/YY'))
> ORDER BY EMPAUX.SUPERNO, LABOUR_HISTORY.EMPLOYEENO,
>     LABOUR_HISTORY.TIMEDATE

> When I attempt to run this statement, I am prompted for the FromDate
and
> ToDate entries and I enter the correct format (10/25/99 and 10/31/99).

> The response that I get back is ORA-01840 - Input value not long
enough for
> date format.

> Is there anything that any of you can consider as being improper with
the
> way this statement is written?

> Thanks in advance for all of your support.

> Ashi Sheth
> Applied Aerospace Structures Corp.


Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Question: Oracle 7.3, Visual InterDev, Stored Proceedure

I have all the components that are needed and have check each of the installations
and functions and everything seems set up fine.

Tech used.

IIS 4.0 on NT SP4, Active Server Pages (ASP), Oracle 7.3.3.0.0, Required
Support Files 7.3.3.5.2, SQL Net 2.3.3.0.4, and  ADO 2.0.

Currently I have tried using both VI 1.0 and VI 6.0 to run the stored proceedures.
I can get then to run on VI 6.0 by selecting the stored proceedure, right
clicking and selecting run and giving it values. But if I try to run the
stored proceedure from a asp page I get errors. (sorry I don't have the syntax
right now.) But they are like "The application is using a value of the wrong
type for the current operation. " and such.

They were all in one package but we created the same individually as well,
because there were no global variables required.

Is anyone doing VI/ASP development and using stored proceedures with success.
Please post samples.

Or anyone creating VB components, I could create a webobject  in vb that
does the stored proceedure and expose the values. But I'd like to just do
the connection with vbscript.

The returned values for the stored proceedures are anything from a single
true/false value to a recordset. Thanks for any help.

Please email the reply to me. I need this one as fast as I can get it.

Thanks more than you know.

Craig G.


2. Can't access OLAP via Excel... AUGH

3. VA-RICHMOND-111235--Visual InterDev-Visual Basic-Visual C++-MS ACCESS-ORACLE-MTS

4. Dynamic Evaluation

5. cant login to local SQL server on win98 via visual Interdev

6. What does it mean the "0xE06D7363: Microsoft C++ Exception" ?

7. Visual Interdev & SQL Server Security via DialUp

8. Visual Basic with Informix

9. cant login to local SQL server on win98 via visual Interdev

10. Oracle 7.3 and Oracle 8i with Visual Basic

11. Oracle 7.3 Time Field to SQL 7.0 via ODBC

12. SQL7 to ORACLE 7.3 via ODBC - Advice Needed

13. Opening Oracle 7.3 database via ODBC in VB4