SqlDbx Forum

SqlDbx

You are not logged in.

#1 2015-04-22 01:03:28

KMoff
Member

Cast and Convert altering numbers

Hi,

I am using an ODBC Connection to ServiceNow and write code using SqlDbx.

I have been having issues when trying to cast or convert a number.

A simple count(*) may return say 60 records, and I can confirm that the true number is 60, yet if I try the following cast or converts I get the below numbers:

convert(count(*), SQL_smallint) = 180
cast(count(*) AS DECIMAL(10,2))  = 180
cast(count(*) AS Numeric(10,2))  = 180


SELECT CAST (number AS DECIMAL(10,2))
FROM (
SELECT count(*) AS number
FROM incident
) = 180


I have tried downloading a new version of SqlDbx but no change.  I use SqlDbx in a similar fashion on another account and do not get this issue.

Why is this happening?

Thanks
Kirsty

Offline

#2 2015-04-22 10:11:19

sqldbxhelp
Administrator

Re: Cast and Convert altering numbers

I am not sure what is going on here.
SqlDbx does not do any processing just retrieves and shows the data.
We do not have any experience with ServiceNow.
Do you have a way to run your queries using different tool?
Do results look correct in this case?
I am not sure I understand what you mean by "similar fashion on another account".

Offline

#3 2015-04-22 23:27:10

KMoff
Member

Re: Cast and Convert altering numbers

I have now tried running these scripts in various other programs and still get the wrong numbers.  I think it must be something wrong with the ServiceNow Instance and have logged a ticket with them.

What I mean by  "similar fashion on another account" is that I use SqlDbx to access a different companies instance of ServiceNow and I do not get these same problems.

Offline

Board footer

Powered by FluxBB