Re: Data Driven Query - Lookup where Clause

From: Allan Mitchell (allan_at_no-spam.sqldts.com)
Date: 03/22/04


Date: Mon, 22 Mar 2004 14:58:32 -0000

You can convert the smalldatetime values to the YYYYMMDD format by using
(and presuming SQL Server)

CONVERT(CHAR(8),DateField,112)

-- 
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Peter Newman" <anonymous@discussions.microsoft.com> wrote in message
news:4EF2BCC8-62BB-4191-8ED2-5A45B7957548@microsoft.com...
> im trying to write a lookup query for a Data driven Query. Im having
problems with one part of the query which is in the 'where' clause.
>
>  im trying to compare a string value from a text file  to a smalldatetime
value.
>
>   Smaledatetime value = 2004-02-27 00:00:00:00
>   textfile  value            = '20040227'
>
>  im looking to get the record where the smalldatetime value = textfile
value.
> Ive tried converting the textfile value to '27/02/2004' but am getting
nowhere


Relevant Pages

  • Re: Cross Tab Query Help!
    ... This is my first query: ... FROM dbo.ViwOEE_Source LEFT OUTER JOIN (SELECT SeqNum as Seq, MachNum ... WHERE (DateCode BETWEEN CAST('20060713' AS smalldatetime) ... Are you doing this in Access against a linked SQL Server table, ...
    (microsoft.public.access.queries)
  • Re: Cross Tab Query Help!
    ... Have you tried a SQL Server news group? ... This is my first query: ... FROM dbo.ViwOEE_Source LEFT OUTER JOIN (SELECT SeqNum as Seq, MachNum ... WHERE (DateCode BETWEEN CAST('20060713' AS smalldatetime) ...
    (microsoft.public.access.queries)
  • How do I Convert a Date/Time Field to Just a Date Field?
    ... In a SQL Server 2K table, I have a field formatted as a SMALLDATETIME ... In my query, I need to work with only the "DATE" part of this ... mydatetime, 102), but it doesn't seem to drop the hours and minutes. ...
    (microsoft.public.sqlserver.programming)
  • Data Driven Query - Lookup where Clause
    ... im trying to write a lookup query for a Data driven Query. ... Im having problems with one part of the query which is in the 'where' clause. ... im trying to compare a string value from a text file to a smalldatetime value. ... Ive tried converting the textfile value to '27/02/2004' but am getting nowhere ...
    (microsoft.public.sqlserver.dts)
  • Re: CONTAINS performance
    ... That said, and with the query plan, I can start to give you more ... relational join in the context of the free-text optimization, ... SQL Server tables. ...
    (microsoft.public.sqlserver.fulltext)

Quantcast