# Power Query If Statements with Dates



## cmcreynolds (Sep 2, 2015)

I'm trying to use an If statement in the (Power) Query Editor that includes a date, but it's not recognizing my syntax:

if [Close Date]=6/29/2015 then Date.AddDays([Close Date], 2) else [Close Date])

(Trying to have everything that is the date 6/29/2015 to be 7/1/2015)

I've tried 6/29/2015 and "6/29/2015" - am I missing how to do this? 

Thanks!


----------



## cmcreynolds (Sep 2, 2015)

if [Close Date]=#date(2015,06,29) then Date.AddDays([Close Date], 2) else [Close Date])

That works


----------



## billszysz (Sep 2, 2015)

Hi,
Instead of #date(2015,06,29) you can use Date.FromText("6/29/15", "en-US") or Date.From("6/29/15", "en-US")

Regards


----------

