PREFIX-change valid values was ([ic] sort option)

Paul Jordan interchange-users@interchange.redhat.com
Mon May 27 02:28:01 2002


X-No-Archive: Yes
> > I open up my options with * when I am trying to get something to work
> :)
> >
> > I don't think what I want to do will be possible. I have been
> > experimenting
> > with date_convert and trying all sorts of (sorts). I found this in the
> > docs:
> >
> > -------
> > "The repeating value must be a tag interpolated in the search process,
> > such
> > as [item-field field] or [item-data database field]. "
> > ---------
> >
> > I am not sure how stringent this statement actually is, but it seems
> > pretty
> > solid.
> >
> > I can output a value by date_convert OR my [sql-calc] method above, to
> be
> > consistent with how I want to sort. But it will not accept it. I can
> sort
> > by
> > any field, but not a munged value from a field. (I am sorting my the
> MONTH
> > ONLY from => yyyy-mm-dd)
>
> What is date_convert, a IC function or a database built in function?
> Have you tried doing something like this if you are using MySql:
>
> SELECT field_1, field_2, date, substr(date, 5, 2) AS month FROM ....
>
> Then use [sql-param month] as your change condition?
>
> This will use the built in mysql substr function and return only the
> month part of the date field which should be consistent with the
> requirements for sql-change since it should be seen in the resultset as
> a returned field.


Ron!

I LOVE YOU :)

Thanks so much. This worked out wonderfully! I am new to perl and mysql,
have just started reading two books on them. 50 more pages and I would have
found "substring".

You know, I just happen to finish reading about substr in perl a few days
ago, I didn't even think to check if the same function is built into mysql.
It is a little different though, in perl you start at 0 position, and in
mysql it seems you start at 1 position. That seems wired. I had to use
(date, 6, 2) as opposed to perls ($date, 5, 2). What's that about?

Thanks again Ron, Racke and Kevin. This substring in mysql really opens
possibilities up, and using DATE really streamlines things.

IOU 1

Paul