Jump to content

Megpiri

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Megpiri

  1. I'm trying to change the date format in the below query to MM-01-yyyy but when I change it throws up an error. HELP! - Thanks

     

    cast(format(transdate, 'yyyy-MM-01') as Date) as 'Start Date',
      eomonth(cast(format(transdate, 'yyyy-MM-01') as Date)) as 'End Date',
      'Mobile (ex)'as 'Type of Expense',
      CASE left(general2,8)
        WHEN 'Outgoing'  THEN 'Mobile Phone Charges - '
        WHEN 'Incoming' THEN 'Mobile Phone Charges - '
        WHEN 'Parking ' THEN 'Parking Charges - '
     WHEN 'Landline' THEN 'Landline Phone Charges - '
     ELSE 'DATA - '
        END
        + datename(month,cast(format(transdate, 'yyyy-MM-01') as Date)) + ' ' +
        + CAST ( YEAR(cast(format(transdate, 'yyyy-MM-01') as Date)) as varchar)

×
×
  • Create New...