tMap Component Transformation
The Map Editor allows us to enter a Mapping Expression for each of the columns in each output Schema.
To remove all digits characters from a string
Easy way to learn and implement the Microsoft technologies.
Suppose that you need to send an email alert to your customers to remind them to pay the invoice bill after 30 days of invoice generation as per their contract. Hence, you have to write an SQL based program to check all the unpaid invoices which comes under this conditions.
Value (any one of)
|
Explanation
|
year, yyyy, yy
|
Year interval
|
quarter, qq, q
|
Quarter interval
|
month, mm, m
|
Month interval
|
dayofyear
|
Day of year interval
|
day, dy, y
|
Day interval
|
week, ww, wk
|
Week interval
|
weekday, dw, w
|
Weekday interval
|
hour, hh
|
Hour interval
|
minute, mi, n
|
Minute interval
|
second, ss, s
|
Second interval
|
millisecond, ms
|
Millisecond interval
|
----
Difference in years
SELECT
DATEDIFF(year, '2012/04/28', '2014/04/28');
Result: 2
----
Difference in months
SELECT
DATEDIFF(month, '2014/01/01', '2014/04/28');
Result: 3
----
Difference in days
SELECT
DATEDIFF(day, '2014/01/01', '2014/04/28');
Result: 117
----
Difference in hours
SELECT
DATEDIFF(hour, '2014/04/28 08:00', '2014/04/28 10:45');
Result: 2
----
Difference in minutes
SELECT
DATEDIFF(minute, '2014/04/28 08:00', '2014/04/28 10:45');
Result: 165
|
Hope you enjoyed and found this essay useful. Please leave your questions and suggestions in the comments section. Many thanks for reading! 😊
Your support is greatly appreciated! If you found this article valuable, don’t forget to clap👏, follow✌️, and subscribe❤️💬🔔 to stay connected and receive more insightful content. Let’s grow and learn together!
⭐To learn more, please follow us —
http://www.sql-datatools.com
⭐To Learn more, please visit our YouTube channel at —
http://www.youtube.com/c/Sql-datatools
⭐To Learn more, please visit our Instagram account at —
https://www.instagram.com/asp.mukesh/
⭐To Learn more, please visit our twitter account at —
https://twitter.com/macxima
⭐To Learn more, please visit our Medium account at —
https://medium.com/@macxima
COUNT (<expression>)
counts rows where the <expression>
is not null.
--This will return count of 2
;WITH CTE
AS (
SELECT NULL AS Id
UNION ALL
SELECT 1 AS Id
)
SELECT COUNT(*) FROM CTE
--This will return count of 1
;WITH CTE
AS (
SELECT NULL AS Id
UNION ALL
SELECT 1 AS Id
)
SELECT COUNT (Id) FROM CTE
|