MySQL Or Any SQL Syntax
In CLARION, if I want to take a piece of a string, I can say TheString[3:5].
With MySQL, I want to default a field to the last two digits of the year.
How can I specify a default for this. My date is coming in as a @D17 which I
will change to a @D12. This means that I would want to grab the 3rd and 4th
positions of that date string.
I'm doing this to make a registration number unique with a two digit year
end and a table auto-incremented 4 digit field.
One thing I've found is that I can't specify this multiple field index as
unique in the table structure because it will burp with the two digit field
being the same for a full year of the number (that do change incrementally).
Without specifying this as a unique key, it works well and still gives me
that unique registration key.
Anyone have any idea about my original question of string slicing on that
date so I can set my default vaiable to positions 3 and 4 of the date
string?
Your help is appreciated.
Vincent Crosby
CSI, Inc.
|