Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find the Datatype

Status
Not open for further replies.

Prapagar

Programmer
Sep 10, 2003
11
0
0
IN
How to find a column in Impromptu reports whether that column is numeric or non-numeric, depending on the datatype some calculations has to be carried out(if numeric).

Can anyone pls tell me how to find the datatype?


Thanx

Prapagar
 
hello again prapagar,
In Impromptu, open (or create) a report with the relevan columns in and retrieve data. Goto Report and then query. Under the Profile tab, click on query columns. Data type is revealed for each column.
HTH
lex
 
Thanx again Lex,

I've 5 Columns for a report.Those five columns in the database is VARCHAR2.Those Columns can have Numeric as well as Non-Numeric data.here I've to do few calculations if those Columns have Numeric data(still VARCHAR2 in DB) by converting the data using the function STRING-TO-NUMBER else I've to leave it as String.

There is no function to find the data is numeric or non-numeric.

I think u might've got clear picture of my problem.

Appreciate ur help.

Thanx again

Prapagar.
 
I've worked with programming languages without datatypes so I get to be a bit inventive with this situation. Your problem intrigued me. String-to-number fails with Alpha data, but string-to-integer doesn't. The best I could come up with using Impromptu functions was this as a flag:

If (string-to-integer (Column) =0 ans ascii-code(Column) <> 48) then ('Alpha') else ('Numeric')

Unfortunately it won't work if the first character of the data item is numeric and the rest alpha.
Does that help?

If you have access to the datasource you could create a numeric version of the data item there or possibly use SQL to do the calculation . A final possibility I can think of which clearly won't always be appropriate, is to use something like Access as an intermediate data source and do the calculation there.
Simon Rouse

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top