Re: Format Question



On 8/15/07, Mathew Snyder <theillien@xxxxxxxxx> wrote:

How would I go about sub-listing something. For instance, if I have a work
order that has been worked on during different days, I want to list the work
order once and each day below it. It would look like this:

Ticket ID Subject Date hh:mm
--------------------------------------------------------
12345 Ticket Subject MM/DD/YYYY 1:00
MM/DD/YYYY 2:00
MM/DD/YYYY 3:00

So basically, I need the ID and Subject to only be printed on the first line and
only the Date and hh:mm on each successive line. How would I do this with
format? Would I need two different formats? One for the first line and another
for each subsequent line?

There may be a simpler way. For example, if you're willing to use the
destructive caret, you could write a format including something like
this:

^>>>>> ^>>>>>>>>>>>>>>>>>>>>> @>/@>/@>>> @>:@>
$ticket_id_copy, $ticket_subject_copy, $month, $day, $year, $hour, $minute

(And do you really need to use the ambiguous format MM/DD/YYYY instead
of the logical descending order of YYYY/MM/DD?)

When you refill the two _copy variables, they'll be consumed on the next write.

But the simplest way of all may be to avoid using formats. Formats are
wonderful when they do what you want, they do all that you want, and
they can do all you will ever want. But if you will ever want more
than formats can give you, you'll find yourself ripping out the output
code of your program and re-writing it from scratch. That's the
heartbreak of formats.

It may be that you're able to do all you want with formats; there are
a lot of tricks out there. But in the long run, formats may or may not
be the easy way to get the job done.

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training
.



Relevant Pages

  • Re: Recently Added in WMP11 - more observations
    ... Now that sounds like a serious flaw in the coding of Windows Media Player that it cannot handle local date formats for the customer's PC. ... If you go to the Regional and Language Options control panel: Customize: ... Date options and change the Short Form to MM/DD/YYYY, ...
    (microsoft.public.windowsmedia.player)
  • Re: Dates in Pivot Table out of sequence - help
    ... I am sure it is really a date because when I re-format the column to ... different date formats (mm/dd, mm/dd/yyyy, etc) all the values change, ...
    (microsoft.public.excel.misc)
  • Re: format(EnterDate, "mm/dd/yyyy")
    ... Douglas J. Steele wrote: ... ignorant of other date formats than mm/dd/yyyy. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Format Question
    ... Tom Phoenix wrote: ... MM/DD/YYYY 2:00 ... But the simplest way of all may be to avoid using formats. ... Stonehenge Perl Training ...
    (perl.beginners)
  • Re: Access Databse "Select * from Bilag Where Mdates Between #1/1/2006# And #31/1/2006#"
    ... date formats were always yyyy/mm/dd. ... Function fDateToString(byVal adtmDate as Date) as String ... Dim lsEnclosure as String ...
    (microsoft.public.dotnet.languages.vb)