C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Suggestion needed for select query


Posted Date: 21 Nov 2008      Posted By: rahul      Member Level: Silver     Points: 1   Responses: 4



My query is
SELECT name,address,date FROM data i can able to load it in grid but the thing is i want to load it default by current month of the "date" field the current month should be the computer present month





Responses

Author: saisrikanthreddy    21 Nov 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 3

Hey rahul,

You can say month(getdate()) inorder to get the current month of the current date.
All the best.

*************
Regards,
SaiSrikanthReddy



Author: Anil Kumar Pandey    21 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

hi,


U can use the query like this


Select * from tabname where date=getdate()


Regards
Anil Pandey

Thanks & Regards
Anil Kumar Pandey



Author: Sriman N Vangala    21 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 4

you can make use of the getdate() with in the query if you wantot get it directly from backend, but if you want to the system date then it would be better to get it form the .net code by using the function SystemTime which retruns the system's present time.

chk this link this may be helpful to ur requirement:
http://www.geekpedia.com/code117_Get-And-Set-The-System-Date-And-Time.html



Author: Legend     21 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 5

you can make use of the getdate() with in the query if you wantot get it directly from backend, but if you want to the system date then it would be better to get it form the .net code by using the function SystemTime which retruns the system's present time.

chk this link this may be helpful to ur requirement:
http://www.geekpedia.com/code117_Get-And-Set-The-System-Date-And-Time.html










or



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Advanced in sqlserver 2005
Previous : Plz verify my select query
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use