MS SQL Server

Add Calculated Column Age

Add Calculated Age Column in SQL Server through Query

Alter table Child_Record

Add Age AS (datediff(year,[BirthDate],getdate() ))
 
 
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: T-SQL Query
Newer Post Older Post Home

Blog Archive

  • ►  2016 (12)
    • ►  October (1)
    • ►  September (1)
    • ►  July (2)
    • ►  June (4)
    • ►  March (2)
    • ►  February (2)
  • ▼  2015 (24)
    • ►  November (1)
    • ►  October (1)
    • ►  August (3)
    • ►  July (4)
    • ▼  June (5)
      • Add Calculated Column Age
      • Trim Leading (First) Charcter - TSQL Query
      • Combine Two Column in One - TSQL Query
      • Split One Column to Three Column - SQL Query
      • Split One Column to 2 column - SQL Query
    • ►  April (10)

Popular Posts

  • SSRS Expression to convert Second to Hours
    Following Expression in SSRS will convert Second to Hours Minutes Second Format HH : MM : SS   =Floor(sum(Fields!Second.Value)/ 3600)...
  • Add Default Constraint GetDate() to Existing Column
    Add constraint default getdate to existing column Alter table [dbo].[Child] Add Constraint DF_Last Default Getdate() For [LastUpdate]...
  • Find Non Integer From SQL Column
    If you want to find Non-Integer from Column in SQL Server  that does not have Data Type integer , Use following SQL Query. Select *  Fr...
  • SQL Query to Convert Multiple CSV Column to Row
    Suppose you have following kind of table that has multiple CSV and you want to convert it to Row. Want Result like :   ...
  • User Define Function When LTrim and RTrim not Working
    Ltrim and RTrim not always Working to remove white space from column because of the special character at end. It may be because user try to ...
  • Add Calculated Column Age
    Add Calculated Age Column in SQL Server through Query Alter table Child_Record Add Age AS ( datediff ( year , [BirthDate] , getdate...
  • Find Primary Key, Foreign Key, Constrain in SQL Table
    Find Column Name, Primary Key, Foreign Key, Constrain for particular Table in Database.     SELECT distinct             ...
  • List all Default Constraints in Table
    Find Default Constraints with Default to in Particular Table in Database. SELECT       c . name AS ColumnName ,     d . n...
  • Find Record From Table That Does Not Exist In Other Table
    Write The SQL Query to Find Record From Table Employee That Does Not Exist in Other Two Table Employee_Ah and Employee_BA Query 1 ...
  • Find Trigger for Table in SQL Server
    Find Trigger for Particular Table in SQL Server     Select     so . Name , Text From             sysobjects so , ...

Followers

Powered by Blogger.