Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > MySQL Or Any SQL Syntax
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 15th March 00:56
vince crosby
External User
 
Posts: 1
Default 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.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666