0

I must translate a Cognos Impromptu 7 query to TSQL. Part of the query includes the following:

nconvert((SUBSTRING((ascii(t1.TargetDate)) from 1 for 4)))

/* 
where: 
    t1 is a table alias
    TargetDate is a BIGINT contains the value 200501
*/

Can someone explain the purpose of the function/expression "ascii"?

(FYI: SQL Server ASCII function produces ascii(200501) ==> ascii(2) ==> 50 )

Bonus: If someone can point me to an online resource that includes the ascii definition, that would be appreciated. My search bore no fruit.

EngineeringSQL
  • 207
  • 2
  • 10
  • I found this IBM developerWorks resource, which suggests that ASCII function performs the same task as TSQL ASCII. http://www.ibm.com/developerworks/data/tutorials/db2-cert9188/section2.html – EngineeringSQL Apr 24 '13 at 17:42

1 Answers1

1

The official Impromptu 7.5 administrator guide is in here:
Impromptu Administration Guide 7.5.0
All functions (including text, numeric and Date / Time functions) are documented here
However, I did not find any ascii function there.
So, the second option is creating an IQD file:
Viewing SQL generated by Impromptu
If this does not help. use SQL Server profiler to see the real SQL statement that impromptu sends:
SQL Server Profiler

Ran Avnon
  • 778
  • 4
  • 7