Home     Preactor®     riteTIME     Sage User Network     REPorts for Sage     WO Receipts     Sage Reporting Services     SQL Reporting Services     Std Costing     Downloads     Blog      
Downloads
 
SQL Week Number function: slectrep_ISOweek.txt             
For example, 25/06/10 would show as "2010 26" becasue it is week 26
Create the function in SQL, then put code similar to this into your views, queries and stored procedures:  select LEFT(scheme.slectrep_ISOweek(scheme.stkhstm.dated), 7) AS yy_wk
Uses the ISO system so it should get it right even if 30th December this year is actually week 1 of next year!
We use it in our Predict Future Stock screen and other REP reports: http://sl-ect.co.uk/REP.aspx
 
Do you want a similar function to fetch the Sage Financial Period Number? It's available as part of the REP system!
For more information click here