You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hey Guys,
so basically I use this SQL statement to calculate the remainder of dividing the current week of the year by five:
SET @MYVAR = (FORMATDATE(GETDATE(), 'w') - (FLOOR(FORMATDATE(GETDATE(), 'w') / 5) * 5))
And when I try to use it with my table
Like this:
SELECT * FROM T1 WHERE 'person' = @MYVAR
It says "The query returned no rows."
What is the problem with that?
When I'm doing
SELECT @MYVAR FROM T1
It's resolved correctly.
Hi @Kamil Graczyk ,
Maybe the following workaround will help your case:
Note that you will need the Table Toolbox macro to nest macros on Confluence Cloud.
Here are the settings of the internal Table Transformer macro:
SELECT *,
(FORMATDATE(GETDATE()) - FLOOR(FORMATDATE(GETDATE())/5)*5) AS 'weeks'
FROM T*
And here is the SQL query for the external Table Transformer macro:
SELECT 'value', 'person' FROM T*
WHERE 'value' = 'weeks'
Hope it will help your case.
Note that you've tried to compare numbers with the 'person' column that contains letters (strings). Seems that the 'value' is a correct field for the case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.