What is in the start time and end time fields? I am guessing a time rather than a date. If that is the case you will have to do some manipulation to just use the time component of GETDATE().
Without knowing the context of the fields in the StartTime and EndTime fields I cannot provide code. Ray Thompson Tau Beta Pi (www.tbp.org) The Engineering Honor Society 865-546-4578 -----Original Message----- From: Michael Kear [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 20, 2004 11:05 AM To: SQL Subject: Time functions I have a radio station application, and we need to display "who's on air now" on the site. We're doing that from a SQLServer database where each show has a start time and a finish time in a datetime field. It's displaying in the form 09:00:00AM when I look at it in Enterprise Manager. How do I find the show that's currently playing? This select statement gives me zero records: SELECT (stuff) from SHOWS WHERE Starttime <= getdate() AND endtime >= getdate() But I'd have thought that would do it? No? Cheers Mike Kear Windsor, NSW, Australia AFP Webworks http://afpwebworks.com .com,.net,.org domains from AUD$20/Year ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=37 Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2061 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
