Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting By Date

Status
Not open for further replies.

slyder04

Technical User
Mar 30, 2010
5
US
Cr 10 Dev
I have a simple report that is grouped by a date and I need to sort those dates starting with August instead of January. I have tried using specified grouping by that did not work. The data is stored as a string (yyyy-mm-dd).

Any Ideas?

Thanks,

Sly
 
Create a formula that looks something like this:

if mid({table.datefield}, 6, 2) = '08' then '01' + {table.datefield}
else if mid({table.datefield}, 6, 2) = '09' then '02' + {table.datefield}
else if mid({table.datefield}, 6, 2) = '10' then '03' +{table.datefield}
else if mid({table.datefield}, 6, 2) = '11' then '04' +{table.datefield}
else if ...<continue for all months>

Sort by this formula but display your date field.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 



How about

Sort By Month({table.datefield})-7

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 



where is my head? That won't work!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
if val(mid({table.stringdate},6,2))-7 <= 0 then
val(mid({table.stringdate},6,2))+5 else
val(mid({table.stringdate},6,2))-7

-LB
 
Thanks for the help, it sorts correctly now.

SL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top