JaybeeSQL (7/19/2016)
J Livingston SQL (7/19/2016)
maybe?
DECLARE @f1 AS VARCHAR(100)= 'The Double Cross (01/Mar/13)';
SELECT CAST(LEFT(RIGHT(RTRIM(@F1), 10), 9) AS DATE);
No that just returns a single date, and one I (would) need to embed per statement at that
I'll rephrase -
I need to order F1 per the dates embedded at the end of F1, so, expected result set (I'm not worried about repeating the date at the end)...
DateTitle
(12/Jan/12)The Setup (12/Jan/12)
(10/Jan/13)Broken Remnants (10/Jan/13)
(08/Jun/13)Big All Over (08/Jun/13)
CREATE TABLE yourtable(
F1 VARCHAR(50) NOT NULL
);
INSERT INTO yourtable(F1) VALUES ('Broken Remnants (10/Jan/13)');
INSERT INTO yourtable(F1) VALUES ('Big All Over (08/Jun/13)');
INSERT INTO yourtable(F1) VALUES ('The Setup (12/Jan/12)');
SELECT F1
FROM yourtable
ORDER BY CAST(LEFT(RIGHT(RTRIM(F1), 10), 9) AS DATE)
DROP TABLE yourtable;
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day