Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


ReportStudio CAST functions

ReportStudio CAST functions

ReportStudio CAST functions


I've SQL Server Column 'DueDate' that is a string data type but it stores a date value
as 'yyyymmdd'(eg:20050816) i want to convert it into integer ,when i use SQLServer function
cast_integer([DueDate])  i'm getting the error that the function does not exist.

please any kind of help would be great i'm stuck with that for couple of days.

THANX alot

RE: ReportStudio CAST functions

select cast('20050816' as datetime)

RE: ReportStudio CAST functions

sorry hit submit a bit quick :P

cast_timestamp('20050816') will give you a real date
cast_integer('20050816') will give you an integer

What I was saying above is that cognos actually does a
convert(int,'20050816') in the SQL itself
not a cast..This should work. I would look at the generated SQL and see if you can figure out what it is actually doing.

RE: ReportStudio CAST functions

Hai thanx for the reply,
but it's working if i give explivitly like'20050816'
and it's not working if i send a column from sqlserver data base
i'm getting that the function does not exist.

QE-DEF-0177 An error occurred while performing operation 'sqlPrepareWithOptions' status='-228'.

UDA-SQL-0219 The function "cast_integer" is not available as an external, database, or built-in function.

RE: ReportStudio CAST functions

Where are you adding this? If you are adding it to an actual SQL statement (tab sql or something) then you must use the proper sql. Cast_integer is not a command that work natively with sql server. You need to use convert

RE: ReportStudio CAST functions

i really thank you for your patience and helping me.

actually i'm getting that column [DUEDATE] from SQLServer into a tabular model
there i dragged 'Dataitem' and in the expression of that i wrote "cast_integer([DueDate])".

How should i use convert in reportnet does it work for any database? could you please give me the syntax?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close