cancel
Showing results for 
Search instead for 
Did you mean: 

SELECT GETDATE() not giving results

Former Member
0 Kudos

Hi All,

I tried firing a fixed query SELECT SUM(PRODUCTION_DATA) FROM TABLE_NAME. but it is not fetching any result.but if i fire SELECT PRODUCTION_DATA FROM TABLE_NAME then it is giving me result.

I dont know what is the problem.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lipsa

Just a silly mistake u hv taken in Query

Use this Query

SELECT SUM(PRODUCTION_DATA) AS TOTAL FROM TABLE_NAME

Dont forget to inform if its working

Regards

Som

Former Member
0 Kudos

Hi Sarkar

Thanks For replying.

My problem is solved.

But that is not a silly mistake. Because that same Query is working properly on other machine but in my machine that is not woking. Now tell me why it is showing so strange beheviour.

Thanks

Lipsa S

Former Member
0 Kudos

Lipsa

This is not clear wat u meant with ur machine or other machine ???!!!

If u use <b>Fixed Query</b> mode in <b>Query Template Editor</b>, then this query SELECT SUM(COLUMN_NAME) FROM TABLE_NAME will not show any result, since <b>this query does not provide any column name which will be shown with the Value of SUM whereas in Query Template it is recommended to have a column name to be displayed</b>.

If u use the same Query in other platform which does not need to show Column name with Value returned by any of Aggregate Functions, it will work.

If it still does not clear ur doubt, ur doubts with details r welcome. [Dont just raise a doubt with limited explanation]

Waiting

Som

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

Lipsa,

It's really quite simple - you need to alias your columns with 'AS', especially with functions or aggregate expressions like sum, min, max, etc.

If you run SELECT GETDATE() in Microsoft's query analyzer it shows the results, but the grid below shows (No column name), and xMII is no different since it wants you to name the resulting column.

Regards,

Jeremy