programming sort order for unusual date time format

J

Jon

Hi,
I am new to programming and having difficulty coding
this. I want to sort the following DateTimeGroup in order
of most recent first on a form: ######ZOCT01

The first four characters are the time, the next 2
are the day. The Z will always be displayed in the 7th
character position from the left. I have tried to parse
the data in the QDE design grid with the following as a
start: Expr1:Right([DateTimeGroup],2)

Of course the effect is that it does not do what I want.
How would I program this to sort? Any hints and/or
beginning lines of code provided would be appreciated.


Thank you,

Jon
 
T

Tim Ferguson

I want to sort the following DateTimeGroup in order
of most recent first on a form: ######ZOCT01

The first four characters are the time, the next 2
are the day. The Z will always be displayed in the 7th
character position from the left. I have tried to parse
the data in the QDE design grid with the following as a
start: Expr1:Right([DateTimeGroup],2)

Of course the effect is that it does not do what I want.
How would I program this to sort?

What you have here is a Big Design Problem. You really need to be storing
these three items in separate fields:

DateCreated DateTime
TimeCreated DateTime
ZField Text(1)

There is an argument for making the two datetime fields into one: if they
refer to the same event, I think I'd merge them. If the Z is always Z, then
it's not worth storing it at all, so it might be possible to get away with
one field: but FGS make it an appropriate data type, not this stupid non-
sortable "intelligent"[1] key.

If you want to make it look like your key, you can use the Format
expression

"hhnndd\Zmmmyy"

but still sort on the actual datetime value. Welcome to database land,
where things are so much better than dBase hell.

B Wishes


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top