Microsoft KB Archive/71357

Works: Sorting and Querying Dates Entered as Text

PSS ID Number: Q71357 Article last modified on 06-12-1996

1.00 1.05 2.00

MS-DOS

= SUMMARY =

If dates are entered as text rather than in a valid Works date format, limited query functions may still be performed as long as all the dates have been entered the same way.

For example, the date

&quot;01-01-91

isn’t in Works format, but it can still be operated on.

To determine whether a date has been entered as text or in a valid Works date format, place the cursor in the field containing the date. Works displays the contents of the field in the formula bar (under the word “File” in the menu bar). Text will be preceded by a quotation mark (&quot;); numbers will not.

A date entered as text cannot be sorted completely; the dates will be organized by month and day, but years will be out of order.

Queries will not find a range of text dates (for example, queries won’t find all dates between March 6th and March 20th.)

= MORE INFORMATION =

Querying
To query for a specific date (for example, March 12, 1988), type the exact date as follows:

=“03-12-88”

To query for a particular year, type the number of the year (for example, 88) and use question marks in the rest of the date query format as follows:

=“??-??-88”

The < (less than) and > (greater than) operators won’t function correctly with dates entered as text. Ranges of text dates must be found with the | (or) operator. For example:

==“??-??-88|=”??-??-89|=&quot;??-??-90

will find all entries for the years ’88, ’89, and ’90.

Sorting
If the field is used for a sort field, text dates will be arranged according to their first digit, instead of by the last two. For example, the four dates below will be sorted in the following order:

“01-01-88”01-02-82 “01-03-86”01-03-87

Note that the year is sorted according to the month. This is the reverse of sorting an actual date field.

KBCategory: kbother KBSubcategory: dworkskb Additional reference words:

=
================================================================ Copyright Microsoft Corporation 1996.