Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Calculate days since created table transformer

Edited

Hi,

In my Table Transformer, I would like to calculate the number of days since Created.

The following select statement produces what you see in the attached.

SELECT FORMATDATE(NOW()), FORMATDATE(T1.'Created') FROM T*

However, the below produces nothing. What am I missing?

SELECT FORMATDATE(NOW()) - FORMATDATE(T1.'Created') FROM T*

Thank you.now.png

 

UPDATE: From one of the online post, I was able to find the answer.

(CAST(ROUND(ceiling(DATEDIFF(DAY,T1.'Created',NOW())))as int))

 

2 answers

1 accepted

3 votes
Answer accepted
Katerina Kovriga _Stiltsoft_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jul 19, 2022

Hi @Leona Vo ,

You may also try the following SQL query:

Tue 6-1.png

SELECT *,
DATEDIFF(day,T1.'Date',"today")
AS 'Date Diff'
FROM T*

Tue 6-2.png

The date format for this example in the Table Transformer macro settings (Settings tab -> Date format) should be set as "m/d/y".

Hope this also helps.

Hi @Katerina Kovriga _Stiltsoft_ thank you for your reply. Your solution is much easier to read and understand. It works beautifully. I add ROUND() to the function to produce integer.

SELECT T1.'Created', ROUND(DATEDIFF(day, T1.'Created', "today")) as 'Ticket Age' FROM T*

arijit chatterjee
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Nov 16, 2023

Hi,

Thanks for your post. I also had a similar issue previously but right now i have got the ticket age from your query but next is that i also need that out of the total days say 100 there will be Saturday and Sunday as well , how to reflect correct number of days in Integer excluding Weekends. Any help here will be much appreciated!!

 

Thanks

Arijit

Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Nov 16, 2023

(CAST(ROUND(ceiling(DATEDIFF(DAY,T1.'Created',NOW())))as int))

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events