dbTalk Databases Forums  

Re: Break-on week query

comp.databases.pick comp.databases.pick


Discuss Re: Break-on week query in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bruce Nichol
 
Posts: n/a

Default Re: Break-on week query - 08-11-2006 , 06:46 PM






Goo'day, John,

On 11 Aug 2006 16:00:13 -0700, "johnmarshall (AT) xtra (DOT) co.nz"
<johnmarshall (AT) xtra (DOT) co.nz> wrote:

Quote:
Folks

D3 / NT, and still using AQL (Proc) extensively for reporting. I know,
I know I should get a life and learn Basic, Crystal Reports etc etc
but for 80% of reports proc is plenty good enough. One minor hassle
however - many reports I write have data sorted by date, and the users
often want the date broken by week. (As long as the "week" includes the
working days Mon-Fri I'm flexible about where Sat and Sun fall - ie the
week could be Mon-Sun or Sat-Fri, but Mon-Sun is preferred option.

Question, is there a method (synonym?) I can use to get the break-on
command to get a string of dates to break nicely each time a week rolls
over. (I may have several months worth of dates for example so there
will be multiple weeks within the data.)


Oh dear, oh dear...... don't tell me that D3 is so lacking that it
doesn't have a "WI" date conversion .... WI = ISO Week No

Under the ISO standard, a week always begins on a Monday, and ends on
a Sunday. The first week of a year is that week which contains the
first Thursday of the year, or, equivalently, contains January 4th....
so I'm told

<sardonicism>I suppose you could always wait for RD to implement
something like it, but it mightn't work in the FSI or is that the VME?
What about a NT version or linux version? Or "flashed"?? What, even,
if Peter wants to create a b-tree index on it..... Perhaps you'll be
waiting a long time......</sardonicism>

In the mean-time... OpenQM could be an ideal conversion .....


Regards,

Bruce Nichol
Talon Computer Services
ALBURY NSW Australia

http://www.taloncs.com.au

If it ain't broke, fix it until it is....


Reply With Quote
  #2  
Old   
B Faux
 
Posts: n/a

Default Re: Break-on week query - 08-12-2006 , 01:11 PM







"Tom Phillips" <squash (AT) computer (DOT) org> wrote

Quote:
Oops - I forgot
replacing +1 with -1 will put the saturday and sunday at the end of the
week which is what you asked for.
Sorry.....

"Tom Phillips" <squash (AT) computer (DOT) org> wrote in message
news:c7SdnbmuIsg_oUDZnZ2dnUVZ_tCdnZ2d (AT) comcast (DOT) com...
One of the nice things about "Pick" dates since 1968 is that the
remainder when divided by seven is always the day of week.
So assuming attribute 14 contains a date, then
F;14;C7;R
results in 0 for sunday, 1 for monday, etc....
But more importantly to your needs is that the quotent is a week number
So - F;14;C1;+;C7;/

Yes, I meant 7 plus 1 as well (52.15 weeks in a year and all that)

oops ;-)
BFaux




Reply With Quote
  #3  
Old   
johnmarshall@xtra.co.nz
 
Posts: n/a

Default Re: Break-on week query - 08-15-2006 , 02:04 AM



Tom - thanks for your input. I've visited your website and have got
all the date synonyms up and running nicely on my system now. Thanks
to everyone else who offered suggestions as well.

regards
John

Tom Phillips wrote:
Quote:
John - I answered your query in a prior post, and for longer term reference,
I also added a new section to my little web site called "dictionary
examples" which has yours plus some others that I've found useful.
(...like Google doesn't have enough sites to scan....)
http://www.tom-phillips.info/
Regards, Tom...

snip



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.