Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

select statement by weeks

@Week-4 = t.FriTheWeek

I have a select statement, I just encounter this error for the New year. This is calculated by weeks.
But as you see above i have @Week -4 weeks. But it shows me -3 in the results how can i tell it to if
if minus or less than one week the start from week 52 then go back.

0
Seven price
Asked:
Seven price
1 Solution
 
spprivateCommented:
post your sql query and code here
0
 
LimbeckCommented:
something like

case when @Week-4 <0 then 52+(@week-4) else @week-4 end = t.FriTheWeek
0
 
Seven priceFull StackAuthor Commented:
tks
0
 
HainKurtSr. System AnalystCommented:
try this

((52 + @Week - 4) % 52) = t.FriTheWeek
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now