May 29, 2002 #1 oigo Programmer Apr 27, 2002 23 CO Hello, the getdate() returns the date and the hour of the system, but I need to get only the date using getdate(). how to? thank
Hello, the getdate() returns the date and the hour of the system, but I need to get only the date using getdate(). how to? thank
May 29, 2002 #2 tlbroadbent MIS Mar 16, 2001 9,982 US Select DateOnly= Convert(datetime, int(getdate())) Select DateOnly= Convert(datetime, Convert(char(10),getdate(),101)) Select HourOnly= Hour(getdate()) Select HourOnly= Datepart(hh,getdate()) Select TimeOnly= Convert(char(8),getdate(),8) Terry L. Broadbent - DBA Computing Links: http://tlbroadbent.home.attbi.com/prog.htm faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions. Upvote 0 Downvote
Select DateOnly= Convert(datetime, int(getdate())) Select DateOnly= Convert(datetime, Convert(char(10),getdate(),101)) Select HourOnly= Hour(getdate()) Select HourOnly= Datepart(hh,getdate()) Select TimeOnly= Convert(char(8),getdate(),8) Terry L. Broadbent - DBA Computing Links: http://tlbroadbent.home.attbi.com/prog.htm faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.