Re: FN-FORUM: SQL STATEMENT
date posted 9th September 2005 10:32
Hi Pamela,
The mistake you've made here is to start the substring at position -4
which wont exist. Can you tell us what the format of the date is? if it
is 2004-06-07 for example and you want to check on the year then you'd
have substring(ISSUE_DATE, 0,4) for example.
Kinsley
>Can any one spot what is wrong with this sql statement as it isn't picking
>anything up. It is driving me mad and I need to get it working urgently.
>
>The contents of ISSUE_DATE are in the format 25/9/2003 and it is an sql
>server database
>
>
>strSql = "SELECT * FROM [Order] WHERE Substring(ISSUE_DATE,-4,4) = '2003'"
>
>
>Thanks
>Pam
>
>
>
>
--
Kinsley Ransom
RED:Solutions
12 Oakland St, Silsden, West Yorkshire, BD20 0AX
T: 07730563548
W: http://www.red-solutions.co.uk