Results for "Date"
12 / 184 posts
What difference between the DATEPART() and DATENAME() functions?
The difference between the DATEPART() and DATENAME() functions lies in their definitions. DATEPART() returns an integer that represents the specified datep…
How to get first date of given date or month.
Get First date of month: SELECT DATEFROMPARTS(YEAR(GETDATE()), MONTH(GETDATE()), 1) AS FirstDayOfCurrentMonth Create function for that IF NOT EXISTS (SELEC…
How to get first date From month and Finyear
If we have Finyear and month then we create a date for examples: DECLARE @finyear CHAR(5) = '202425'; DECLARE @month smallint = 5; --Get Year DECLARE @year…
Basic of DAX query
// How to check null ISBLANK(EmployeeDetails[DateofLeaving]) //if condition IF(ISBLANK(EmployeeDetails[DateofLeaving]),TODAY(),EmployeeDetails�…
All Date Components in SQL
We get First Date , Last date ,month number, month Name,Year, Financial Year(Finyear), and Month Year from Date (Date Range of each single date). SET DATEF…
DateTime in Python
In Python, the datetime module provides classes for manipulating dates and times. It offers several functions and methods to create, manipulate, and format…
Date Time in Power BI
In Power BI and DAX, the CALENDAR() and CALENDARAUTO() functions are used to generate a table of dates. These functions are particularly useful for creatin…
Store Error Logs In SQL
Create Table for Error log: CREATE TABLE [dbo].[ErrorLog]( [ErrorLogID] [int] IDENTITY(1,1) NOT NULL, [ErrorTime] [datetime] …
Database trigger to audit (Transaction logs) all of the DDL changes made to the Database
Create table DatabaseLog: CREATE TABLE [dbo].[DatabaseLog]( [DatabaseLogID] [int] IDENTITY(1,1) NOT NULL, [PostTime] [datetim…
PySpark Built-in Functions
These functions are commonly used with groupBy() , agg() , or select() to compute things like sum, average, max, min, count, etc. PySpark functions come fr…
PySpark SQL Date and Timestamp Functions
🔧 Setup First (Optional for Reference) from pyspark.sql import functions as F from pyspark.sql import types as T data = df = spark.createDataFrame(data, )…
Statistics in SQL Server
Statistics SQL Server ke “mind” jaise hote hain. Ye SQL Server ko batate hain ki table me data kis tarah se distribute hai — jaise kitne values unique hain…