Exforsys

Online Training

Problem with queries with DATETIME

This is a discussion on Problem with queries with DATETIME within the SQL Server 2005 Tutorials forums, part of the Articles and Tutorials category; Hi, i have a question related to DateTime date type. 1. how can i retrieve rows related to particular date. ...


Go Back   Exforsys > Articles and Tutorials > SQL Server 2005 Tutorials

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-08-2004, 08:33 PM
Member
 
Join Date: Apr 2004
Posts: 37
NareshShroff
Problem with queries with DATETIME

Hi,
i have a question related to DateTime date type.
1. how can i retrieve rows related to particular date.
i tried using the following statement but im getting syntax error.
Quote:
Create procedure opentasks
{
@activedate as datetime
}
AS
Select Count(*) from tasks where activedate = @activedate
GO
what is wrong in above procedure?
can anyone help me out
Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-09-2004, 03:24 AM
Senior Member
 
Join Date: Nov 2004
Posts: 177
sanereddy is an unknown quantity at this point
Re:Problem with queries with DATETIME

what is the data type for activedate
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-09-2004, 03:51 AM
Member
 
Join Date: Apr 2004
Posts: 37
NareshShroff
Re:Problem with queries with DATETIME

datetime
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-09-2004, 03:26 PM
Senior Member
 
Join Date: Nov 2004
Posts: 177
sanereddy is an unknown quantity at this point
Re:Problem with queries with DATETIME

try this ....

Create procedure opentasks
@activedate as datetime
AS
Select Count(*) from tasks where activedate = @activedate
GO
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Artificial Intelligence FAQ:1/6 General Questions & Answers [Monthly posting] Ric Crabbe and Amit Dubey Tech FAQ 0 06-02-2004 01:12 AM
Artificial Intelligence FAQ:1/6 General Questions & Answers [Monthly posting] Ric Crabbe and Amit Dubey Tech FAQ 0 05-05-2004 04:13 PM


All times are GMT -4. The time now is 10:37 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.