If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Error converting data type varchar to bigint.

Started by HelloCognos, 23 Oct 2018 08:47:59 AM

Previous topic - Next topic

HelloCognos

Hi, :)
I'm getting the following error when I use the following statement.

year(cast([date field],integer))

XQE-DAT-0001 Data source adapter error: com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type varchar to bigint.
CAF-WRN-2082 An error has occurred. Please contact your administrator. The complete error has been logged by CAF with SecureErrorID:2018-10-23-09:36:55.868-#332

This happens even when I use the cat to change the Year returned to an integer.

Thanks in advance for your help!

MFGF

Quote from: HelloCognos on 23 Oct 2018 08:47:59 AM
Hi, :)
I'm getting the following error when I use the following statement.

year(cast([date field],integer))

XQE-DAT-0001 Data source adapter error: com.microsoft.sqlserver.jdbc.SQLServerException: Error converting data type varchar to bigint.
CAF-WRN-2082 An error has occurred. Please contact your administrator. The complete error has been logged by CAF with SecureErrorID:2018-10-23-09:36:55.868-#332

This happens even when I use the cat to change the Year returned to an integer.

Thanks in advance for your help!

Hi,

What are you trying to achieve? Are you trying to extract the year part from a date? If so, is there a reason you can't use the following expression:

extract( year, [date field] )

Looking at your expression, you are casting your date field to an integer, then trying to use a database year() function to pull out the year? Why cast to an integer first? I imagine your database is expecting a date value as the argument to its year() function? Can you explain your approach?

Cheers!

MF.
Meep!

HelloCognos

Yes. yes.. it looks like it's running taking your wise advice.

Now, I'm getting a different error related to below. We just changed a month ago to DQM and I
think the below is coming from that change since it was working right before.

Dump_Them

Case
when ([calculation] < 0) then ('N0')
else
('Yes')
end

and in the detailed Filter of the Query, I use the Dump_Them as
[Dump Them] <> 'No' to include only the rows that have Yes.

"Cannot convert the string value 'No' to data type long. for input string 'N'

Sorry, running short of time on this and all the sudden, hitting errors.

Thanks a lot again :) :)

Thanks so much!!

HelloCognos

ok, I'm good!!

I changed everything to 1 and 0 instead of 'Yes' and 'No' and it is working now...

Thanks a lot!!