Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2006

Tip: Looking for answers? Try searching our database.

Using a DateTime with SQL ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Herby - 28 Mar 2006 15:13 GMT
I am using instances of DateTime within my application
and i need their values to be used as selection criteria in an SQL
select clause.

So i need them to return a literal string representation of themselves
in the following format

'{ts '1990-01-01 00:00:00'}'

Where the date can be any valid date as contained in the DataTime
instance.

How can i get them to do this ?
Herby - 28 Mar 2006 17:01 GMT
Please help im stuck on this?

The database server expects it in the following format
'{ts '1990-01-01 00:00:00'}'

But Datetime does not seem to provide a method to return it in this
universal format.

When i use a DataTime object as a DbParameter - i get similar problems.

Why all these problems with Dates still all the time?
Herby - 29 Mar 2006 10:01 GMT
I really need some help on this.
My database server will only accept dates in the above format
{ts '1990-01-01 00:00:00'}

How do i get DateTime to return its values in this format?
Its hard for me to believe that something does not already exist to do
this?
I hate to re-invent the wheel.

Or i need confirmation that i need to implment a custom formatter?
If so will DbParameter pick this format up?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.