Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
|
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics 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 September 5th, 2007, 03:14 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default HELP!!! retrieving time and date from SQL 2005

Hi all

How am i able to retrieve time and date individually from datetime format SQL 2005?
I'm using Visual Basic 2005 to retrieve it.

Thanks.

 
Old September 11th, 2007, 10:01 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default

Well, can you be a bit more elaborative!!

Regards
Mike
 
Old September 11th, 2007, 10:28 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

A potential query would be:

SELECT Convert(Varchar(10), getdate(), 101) as DateNow, Convert(varchar(10), getdate(), 108) as TimeNow

which returns

DateNow TimeNow
09/11/2007 11:30:52

For all convert formats go here
http://msdn2.microsoft.com/en-us/library/ms187928.aspx

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Retrieving Error toddw607 Access 4 February 27th, 2007 02:54 PM
sql date/time keyvanjan Classic ASP Basics 5 July 22nd, 2006 03:20 PM
Best method to store date & Time with SQL 2000 harini19 Java Basics 0 February 15th, 2006 12:52 AM
passing date time values to sql ashokparchuri ADO.NET 4 March 15th, 2005 01:47 AM
Retrieving file create time [email protected] ADO.NET 1 July 9th, 2003 09:22 AM





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