472,344 Members | 2,515 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,344 software developers and data experts.

Using LIKE with underscore and forward slash..

Hello All,

DDL Statements:

CREATE TABLE [dbo].[Table1] (
[MyDate] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
I have a varchar column which represents dates in YYYYMMDD and MM/DD/YY
formats. If I query using:

SELECT MyDate FROM Table1
WHERE DOB LIKE '________'

Why aren't the dates in MM/DD/YY returned ? Is the / a special
character in T-SQL ?

Thanks in advance

Jul 23 '05 #1
1 6119
On 8 Mar 2005 06:14:40 -0800, hharry wrote:

(snip)
I have a varchar column which represents dates in YYYYMMDD and MM/DD/YY
formats.
Hi hharry,

That's a bad idea to start with. Please use a datetime column for dates.
If I query using:

SELECT MyDate FROM Table1
WHERE DOB LIKE '________'

Why aren't the dates in MM/DD/YY returned ? Is the / a special
character in T-SQL ?


What's in the DOB column? Your DDL includes only the MyDate column!

In case this is a type and you really meant
WHERE MyDate LIKE '________'
then I can't reproduce the problem:

-- Copied from your post
CREATE TABLE [dbo].[Table1] (
[MyDate] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL
) ON [PRIMARY]
GO
-- Inserted my own sample data
insert Table1 (MyDate) values ('20050308')
insert Table1 (MyDate) values ('08/03/05')
go
-- Copied from your post; changed DOB to MyDate
SELECT MyDate FROM Table1
WHERE MyDate LIKE '________'
go
-- Cleanup
drop table Table1
go

If I run the script above, both rows are returned.

Could you post some SQL to enable me to reproduce the problem on my
computer?

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Stephen Ferg | last post by:
I have a question that is not directly Python-related. But I thought I'd ask the most erudite group that I know... :-) When did Windows start...
3
by: Vincent Texier | last post by:
Hello, I want to send 3 chars in hexa code to the serial port. So I type in a tkinter entry : "\x20\x01\x21" The string is set in a...
4
by: Frank | last post by:
Hi, I'm not familiar with JavaScript but have to fix a problem. Please see below part of the HTML code with contains my question: The problem is...
3
by: COHENMARVIN | last post by:
I put the following code in my asp.net page: dbPath = MapPath("/FBDB/db1_newport2003.mdb") strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"...
4
by: Jon Weston | last post by:
Hi all. I'm trying to use the Internet Transfer Control in an Access03 database to upload a file using FTP. It's not giving me any errors but is...
2
by: Greg Collins [Microsoft MVP] | last post by:
In reviewing my web site statistics, I see that I get 404 errors (often enough to make me ask about it) when users try to click on a link to a secure...
1
by: Kberg | last post by:
In case anyone is interested, this is how I solved the problem of replacing a back slash with a forward slash (as in being able to access a...
0
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the...
2
by: Perl Beginner | last post by:
Hi, Is there a way to find a line in a text file that starts with a forward slash? This is how i find a line in text file that starts with a word...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.