|
|
MS Query and date format
Hi
I have a csv file that I try to link with Excel spreadsheet using MS Query.
I have one issue: the date format in MS Query is incorrect. MS Query imports
a column as YMD when it should be DMY.
How can I change this?
Kind regards
IgorM
|
|
0
|
|
|
|
Reply
|
IgorM
|
2/23/2010 8:06:50 PM |
|
hi
MS Query is good but sometimes you may have to do a tad bit of clean up
after the refresh.
how are you refreshing now?
all of my MSQ's refreshed from a command button on the sheet. if i had your
problem i might do something like this......
Sub RefreshData()
Sheets("Sheet1").range("A1").Refresh Backgroundquery:=False
Range("G:G").NumberFormat = "mm/dd/yyyy"
'or
'Range("G:G") = Format(Range("G:G"), "mmddyyyy")
Msgbox "i'm done"
end sub
the above would work only if you import was true numbers.
if the MSQ is importing the data as text you can use text to column to flip
it around.
parse it as delimited and on step 3,in column data format(upper right)
choose date and from the drop down, choose YMD. if you refresh frequently
then you might want to do that on record and add the code to your refresh
code.
my thoughts
regards
FSt1
"IgorM" wrote:
> Hi
>
> I have a csv file that I try to link with Excel spreadsheet using MS Query.
> I have one issue: the date format in MS Query is incorrect. MS Query imports
> a column as YMD when it should be DMY.
> How can I change this?
>
> Kind regards
> IgorM
>
|
|
0
|
|
|
|
Reply
|
Utf
|
2/24/2010 1:20:14 AM
|
|
hi
sorry. made a mistake.
line in the code....
> Sheets("Sheet1").range("A1").Refresh BackgroundQuery:=False
should be....
Sheets("Sheet1").range("A1").Querytable.Refresh BackgroundQuery:=False
sorry bout that
regards
FSt1
"FSt1" wrote:
> hi
> MS Query is good but sometimes you may have to do a tad bit of clean up
> after the refresh.
> how are you refreshing now?
> all of my MSQ's refreshed from a command button on the sheet. if i had your
> problem i might do something like this......
>
> Sub RefreshData()
> Sheets("Sheet1").range("A1").Refresh Backgroundquery:=False
> Range("G:G").NumberFormat = "mm/dd/yyyy"
> 'or
> 'Range("G:G") = Format(Range("G:G"), "mmddyyyy")
> Msgbox "i'm done"
> end sub
>
> the above would work only if you import was true numbers.
> if the MSQ is importing the data as text you can use text to column to flip
> it around.
> parse it as delimited and on step 3,in column data format(upper right)
> choose date and from the drop down, choose YMD. if you refresh frequently
> then you might want to do that on record and add the code to your refresh
> code.
>
> my thoughts
> regards
> FSt1
>
> "IgorM" wrote:
>
> > Hi
> >
> > I have a csv file that I try to link with Excel spreadsheet using MS Query.
> > I have one issue: the date format in MS Query is incorrect. MS Query imports
> > a column as YMD when it should be DMY.
> > How can I change this?
> >
> > Kind regards
> > IgorM
> >
|
|
0
|
|
|
|
Reply
|
Utf
|
2/24/2010 1:28:01 AM
|
|
The data is returned to a PivotTable which is set to refresh on file
opening.
So, I'd rather want to set the year format before the data is imported by
MSQuery.
"FSt1" <FSt1@discussions.microsoft.com> wrote in message
news:53010346-1DFD-4869-B42F-2ED1561068F4@microsoft.com...
> hi
> sorry. made a mistake.
> line in the code....
>> Sheets("Sheet1").range("A1").Refresh BackgroundQuery:=False
> should be....
> Sheets("Sheet1").range("A1").Querytable.Refresh BackgroundQuery:=False
>
> sorry bout that
> regards
> FSt1
>
> "FSt1" wrote:
>
>> hi
>> MS Query is good but sometimes you may have to do a tad bit of clean up
>> after the refresh.
>> how are you refreshing now?
>> all of my MSQ's refreshed from a command button on the sheet. if i had
>> your
>> problem i might do something like this......
>>
>> Sub RefreshData()
>> Sheets("Sheet1").range("A1").Refresh Backgroundquery:=False
>> Range("G:G").NumberFormat = "mm/dd/yyyy"
>> 'or
>> 'Range("G:G") = Format(Range("G:G"), "mmddyyyy")
>> Msgbox "i'm done"
>> end sub
>>
>> the above would work only if you import was true numbers.
>> if the MSQ is importing the data as text you can use text to column to
>> flip
>> it around.
>> parse it as delimited and on step 3,in column data format(upper right)
>> choose date and from the drop down, choose YMD. if you refresh frequently
>> then you might want to do that on record and add the code to your refresh
>> code.
>>
>> my thoughts
>> regards
>> FSt1
>>
>> "IgorM" wrote:
>>
>> > Hi
>> >
>> > I have a csv file that I try to link with Excel spreadsheet using MS
>> > Query.
>> > I have one issue: the date format in MS Query is incorrect. MS Query
>> > imports
>> > a column as YMD when it should be DMY.
>> > How can I change this?
>> >
>> > Kind regards
>> > IgorM
>> >
|
|
0
|
|
|
|
Reply
|
IgorM
|
2/24/2010 5:42:04 PM
|
|
|
3 Replies
883 Views
(page loaded in 0.073 seconds)
Similiar Articles: MS Query and date format - microsoft.public.excel.miscHi I have a csv file that I try to link with Excel spreadsheet using MS Query. I have one issue: the date format in MS Query is incorrect. MS Quer... Format DATETIME to Date in query on linked table - microsoft ...Access 2007 hitting an Oracle Database with MS ODBC Drivers for Oracle V 10.x I am pulling data from a linked Oracle table that contains a datetime... Add leading zero to date field for jan thru sep only - microsoft ...MS Query and date format - microsoft.public.excel.misc Add leading zero to date field for jan thru sep only - microsoft ... MS Query and date format - microsoft.public ... Setting the display format of a query using the DateDiff function ...MS Query and date format - microsoft.public.excel.misc Setting the display format of a query using the DateDiff function ..... date difference expression - microsoft ... Wrong date/time format - can't query - microsoft.public.access ...I have a table that is written to programmatically that has fields for INDATE and OUTDATE. In my stupidity, the line of code that records the date f... Convert Date YYYYMMDD - microsoft.public.access.queries ...Hi All, I need to convert using a query the date format from MM/DD/YYYY to YYYYMMDD. How do I do this? Thanks Matt -- Matt Campbell mattc (at) sa... Convert a non date string to date format - microsoft.public.access ...I am trying to convert a non date string (20071231) to date format (12/31/2007) in access. This data is being imported from another system. I am a... Using Date and time in YYYYMMDDHHMMSS format automatically ...I have a question about using date and time in the following format: yyyymmddhhmmss, i.e. 20070328144801 I have a column in a table called ScLoadTi... Group by date (month & week) in query - microsoft.public ...Hello, I have a query with the following data. completion date, part category, avgLT, countOrder Completion date in format of m/dd/yyyy and there ar... How do I left justify a date - microsoft.public.access.queries ...I have a date with format 'yyyy mmmm'. I would like it left justified. The help says I can use ! but when I type '!yyyy mmmm', Access changes it to ... Using MS Access: a query to change format of date field, ms access ...ms access 2000, hth, yyyy: Well actually you really DON T want to do this. I see NO reason to have a redundant field to display a different format. Evan if you need ... Excel - Ms Query Date Format - I am having... - Free Excel HelpMs Query Date Format - I am having a problem passing a date parameter to MS Query... - Free Excel Help 8/1/2012 1:59:31 PM
|
|
|
|
|
|
|
|
|