Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how do i lookup a date field?

Author  Topic 

Topaz
Posting Yak Master

199 Posts

Posted - 2008-09-09 : 10:05:04
As the title says how can i do this in management studio express?

Thanks

JT

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-09 : 10:15:05
something like this

select * from yourtable where datecol = '20080831'



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Topaz
Posting Yak Master

199 Posts

Posted - 2008-09-09 : 10:18:51
that brings up every record in my DB when using this query...

select * from wce_contact where mail1date = '20080701'

Is something not right?


JT
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-09 : 10:28:04
quote:
Originally posted by Topaz

that brings up every record in my DB when using this query...

select * from wce_contact where mail1date = '20080701'


JT



If all of value of your record in table wce_contact column mail1date is that date. Yes. It will bring all records.

What is your issue here ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-09 : 10:30:08
Which result do you get from

SELECT mail1date, COUNT(*)
FROM wce_contact
GROUP BY mail1date
ORDER BY mail1date


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-09 : 11:02:09
quote:
Originally posted by Topaz

that brings up every record in my DB when using this query...

select * from wce_contact where mail1date = '20080701'

Is something not right?


JT



I wouldn't know. There is nothing wrong with the query in terms of syntax. You have to tell us what's wrong. If is is not giving you the result that you want ? Then you have to show us the sample data and the result that you want.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Topaz
Posting Yak Master

199 Posts

Posted - 2008-09-09 : 11:06:48
quote:
Originally posted by khtan

quote:
Originally posted by Topaz

that brings up every record in my DB when using this query...

select * from wce_contact where mail1date = '20080701'


JT



If all of value of your record in table wce_contact column mail1date is that date. Yes. It will bring all records.

What is your issue here ?


KH
[spoiler]Time is always against us[/spoiler]





Its bringing up dates that dont even = 20080701

JT
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-09 : 11:21:14
quote:
Originally posted by Topaz

quote:
Originally posted by khtan

quote:
Originally posted by Topaz

that brings up every record in my DB when using this query...

select * from wce_contact where mail1date = '20080701'


JT



If all of value of your record in table wce_contact column mail1date is that date. Yes. It will bring all records.

What is your issue here ?


KH
[spoiler]Time is always against us[/spoiler]





Its bringing up dates that dont even = 20080701

JT



That is not possible. The dates that you refer is it from column mail1date ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Topaz
Posting Yak Master

199 Posts

Posted - 2008-09-09 : 11:28:07
all i want is to find a certain date that appears in the mail1date field

JT
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-09-09 : 11:37:40
See post made 09/09/2008 : 10:30:08



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-09-10 : 03:11:40
quote:
Originally posted by Topaz

all i want is to find a certain date that appears in the mail1date field

JT


1 What is the datatype of mail1date column?
2 Post the query you used

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -