Solved

DateTime.Parse() problem

Posted on 2004-09-21
1
215 Views
Last Modified: 2012-05-05
Using
DateTime.Parse("15:00")
will pass Today's date + 15:00 into DB and become

21/09/2004 03:00:00 PM

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

If I only want to pass the TIME (15:00) into db and become

03:00:00 PM

in the DB...

how can I parse?

Thanks.
0
Comment
Question by:p931226
1 Comment
 
LVL 6

Accepted Solution

by:
OlegP earned 30 total points
ID: 12120401
convert to string and cut date

1) if result value is YourDateTimeValue datetime
substring(convert(varchar,YourDateTimeValue,100),12,8)

or
2)if result value YourDateTimeValue is varchar
substring(YourDateTimeValue,12,8)

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now