Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2003, 03:33 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default Current Date??

select * from News where Datestamp = Current_Date

I want to choose only the articles from todays date. But this didn't seem to work. Also the Datestamp field holds the date in this format
11/27/2003.

Thanks

__________________
-----------------------------------------------------------
\"Don\'t follow someone who\'s not going anywhere\" John Mason
 
Old November 27th, 2003, 03:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

If that was the format of value stored in DateStamp field, you can use this to sort it out.

select * from News where Datestamp = convert(varchar(10),getdate(),101)

Hope that helps.

Cheers,


-Vijay G
 
Old November 27th, 2003, 04:21 PM
Friend of Wrox
 
Join Date: Aug 2003
Posts: 166
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Works great thanks :-)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Current date format elayaraja.s XSLT 2 August 6th, 2008 03:08 AM
insert current date vsempoux XSLT 10 July 11th, 2008 07:31 AM
Current Date s15199d Reporting Services 2 April 3rd, 2006 12:38 AM
Getting the Current Date in XSLT kwilliams XSLT 2 November 30th, 2005 03:23 PM
Current Date rgudino Java Databases 1 May 5th, 2005 03:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.