DATENAME() function in SQ Server

SQL has a DateName function, however it takes a datetime as a parameter, not a number Usage is as follows DATENAME(month,date) returns Month Name Sample Query SELECT DATENAME(month, GETDATE()) AS ‘Month Name’—————————— Output: January   Suppose i want to print previous month date, how can i do. There is a quick way. print(DATENAME(month,DATEADD (month , […]

Read more โ†’

Design Patterns – ‘Abstract Factory’

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.  An AbstractFactory is a class that exists to create instances of another class. Described on page 87 of the DesignPatternsBook. Typically, if you want to construct instances of a class, where the class is selected at run time, you… […]

Read more โ†’