Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql select upcoming birthdays

SELECT 
  BRTHDATE AS BIRTHDAY
 ,FLOOR(DATEDIFF(dd,EMP.BRTHDATE,GETDATE()) / 365.25) AS AGE_NOW
 ,FLOOR(DATEDIFF(dd,EMP.BRTHDATE,GETDATE()+7) / 365.25) AS AGE_ONE_WEEK_FROM_NOW
FROM 
  "Database name".dbo.EMPLOYEES EMP
WHERE 1 = (FLOOR(DATEDIFF(dd,EMP.BRTHDATE,GETDATE()+7) / 365.25))
          -
          (FLOOR(DATEDIFF(dd,EMP.BRTHDATE,GETDATE()) / 365.25))
Comment

PREVIOUS NEXT
Code Example
Sql :: how to enter psql shell 
Sql :: postgresql get tables where column is foreign key 
Sql :: importing multiple xml files in azure sql database 
Sql :: oracle index hint multiple tables example 
Sql :: oracle grant alter table constraint 
Sql :: sqlite 
Sql :: oracle parse string 
Sql :: what is in operator in sql 
Sql :: while in plsql 
Sql :: select all same column value in sql 
Sql :: what is sql clause 
Sql :: sql joining 3 tables 
Sql :: SQL SERVER microsoft How to Add Column at Specific Location in Table 
Sql :: row over partition in sql 
Sql :: difference berween database and data base management system 
Sql :: multiple tricky query in sql server 
Csharp :: c# get current directory 
Csharp :: unity create random string 
Csharp :: c sharp how to read a text file 
Csharp :: c# combobox prevent typing 
Csharp :: how to index ireadonlycollection c# 
Csharp :: wpf label text in center 
Csharp :: c# or 
Csharp :: get unix time in seconds C# 
Csharp :: urlreferrer in asp.net core 
Csharp :: initialise icollection c# 
Csharp :: bash if null or empty 
Csharp :: unity textmesh pro 
Csharp :: write to file c# 
Csharp :: c# reverse string 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =