Type Changes-Skipping DateTime directly to Date

johnny51981

Active Member
Joined
Jun 8, 2015
Messages
366
Hi All:
I have a number of CSV source files, most of which have numerous columns that are populated with DateTime from the source they are exported from. When I do my load and transform, each of those CSV Date columns are automatically detected as "type datetime", but when I change it to just "type date" the data population results as an Error. All of this is really working my nerve and OCD, not to mention I really want to keep as few steps as possible without degrading the final result.

Is there a way to get to "type date"? Here is the run down of the steps in one of my queries:
Power Query:
let
    FilePath = Excel.CurrentWorkbook(){[Name="FolderPath"]}[Content]{0}[Column1],
    Source = Csv.Document(File.Contents(FilePath & "03. Jobs and Milestones.csv"),[Columns=33]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Survey Start Date", type datetime}, {"Expected Survey Completion Date", type datetime}, {"Survey Completion Date", type datetime}, {"Expected Permit Complete Date", type datetime}, {"Permit Start Date", type datetime}, {"Permit Milestone Complete Date", type datetime}, {"Design Start Date", type datetime}, {"Expected Design Completion Date", type datetime}, {"Design Completion Date", type datetime}, {"Construction Start Date", type datetime}, {"Expected Construction Completion Date", type datetime}, {"Construction Milestone Complete Date", type datetime}}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"Survey Start Date", type date}, {"Expected Survey Completion Date", type date}, {"Survey Completion Date", type date}, {"Expected Permit Complete Date", type date}, {"Permit Start Date", type date}, {"Permit Milestone Complete Date", type date}, {"Design Start Date", type date}, {"Expected Design Completion Date", type date}, {"Design Completion Date", type date}, {"Construction Start Date", type date}, {"Expected Construction Completion Date", type date}, {"Construction Milestone Complete Date", type date}}),

TIA
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,215,761
Messages
6,126,735
Members
449,334
Latest member
moses007

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