Posts

Showing posts from 2013

CASE Statements in A SQL UPDATE Query

UPDATE [account] SET balance = ( CASE WHEN ((balance - 10.00) < 0) THEN 0 ELSE (balance - 10.00) END ) WHERE condition

DBA /BI Engineer Post

Country: Tanzania City: Dar Es Salaam Qualification A Bachelor’s degree in Computer Engineering, Computer Science, Industrial Engineering/Operations  Mathematics, Management Information Systems. Skills in Database operations, SQL queries, etc Knowledge of best practices and principles for ETL, data modeling, dashboards, report design, analytics, and data mining Strong work ethic Ability to multi-task effectively and be comfortable working in a fast-paced, dynamic environment without close guidance or supervision Strong leadership skills Excellent verbal and written communication skills High degree of attention to detAILS dEADLINE 16/07/2013

Find Last Day of Any Month (SQL Server)

a) Find the last day of the previous month, current month and next month. Last Day of Previous Month SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , GETDATE ()), 0 )) Last Day of Current Month SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , GETDATE ())+ 1 , 0 )) Last Day of Next Month SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , GETDATE ())+ 2 , 0 )) b) . Last day of any day specified. Last Day of Any Month and Year DECLARE  @dtDate  DATETIME SET  @dtDate  =  '8/18/2007' SELECT  DATEADD ( s ,- 1 , DATEADD ( mm ,  DATEDIFF ( m , 0 , @dtDate )+ 1 , 0 ))