6 Replies Latest reply: May 28, 2016 11:18 AM by Marco Wedel RSS

    New column from SQL query

    Valentin Plekhanov

      hi

      i'am in traning now

      I have this

       

       

      SQL SELECT AddressLine1,
      CustomerKey,
      DateFirstPurchase,
      EmailAddress,
      EnglishEducation,
      FirstName,
      LastName,
      Gender,
      Phone,
      BirthDate
      FROM AdventureWorksDW2014.dbo.DimCustomer;

       

      need to make new column as "AGE" from BirthDate

       

      if I use AGE(today(),BirthDate) as AGE is not make new column:

      ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: 'today' is not a recognized built-in function name.

      SQL SELECT AddressLine1,

          CustomerKey,

          DateFirstPurchase,

          EmailAddress,

          EnglishEducation,

          FirstName,

          LastName,

          Gender,

          Phone,

          BirthDate,

          age(today(),birthday) as AGE

      FROM AdventureWorksDW2014.dbo.DimCustom

       

      but if I use this function for make dimension is work

       

      please help me........