How to define column in MS Query ???

adiyen1

Board Regular
Joined
Dec 23, 2008
Messages
64
Hai All,

How to define column in MS Query (ODBC) ???

i have one column like Date of purchase. what i want is to define column based on date of purchase the results showing month of the date of purchase


regards
Adiyen
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I should think the MONTH function in query should do it. If not, export your data to Excel and use it's MONTH() function against your date range.
 
Upvote 0
It depends what ODBC driver you are using (ie is it targeting an Access db (in which case MONTH() should work) or an SQL Server one or an Oracle db?
 
Upvote 0
hai RichardSchollar,

It's an Oracle db


>>>>Hai Mr. nbrcrunch the data is very big i export the data excel. The file size goes more than 6 mb. so that i want to export data in pivot table


Regards,

Adiyen
 
Upvote 0
No Month won't work because it's not Access. You need to use an Oracle function which will Cast or convert the values to something else. I am not at all familiar with Oracle syntax so I can't really help other than to suggest you search in Google on Oracle SQL Cast functions and find one that does what you want.
 
Upvote 0
But I thought OP indicating he was using MS Query with an ODBC connection to Oracle. I do the same thing. The Month function in MS Query works for me.
 
Upvote 0
But it won't to an Oracle database (AFAIK anyway) - it depends on the ODBC driver as to what db functions are supported and Oracle doesn't have a Month function (at least I don't think it does).
 
Upvote 0
RETRACTION: OP correct. the function is unavailable. Don't know why I thought it was. Guess I need a another cup of joe.
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top