I have a situation where I need to update a table with a time retrieved from a dropdown list.
CODE...
cmd.SqlParameters.Add((@StartTime, SqlDataType.DateTime).Value =
CDate(DropDownList.SelectedItem.Text)
CODE/
While it does update the tabel row with a portion of the data (for ex.. 9/28/2007 12:00:00). I don't need the date part of the data, because all I am interested in is the time. So when the time in the dropdownlist is 4:30:00 pm, I want that time to be retrieved. Any help is appreciated.
Thanks,
Phoenix
5 2427
I have a situation where I need to update a table with a time retrieved from a dropdown list.
CODE...
cmd.SqlParameters.Add((@StartTime, SqlDataType.DateTime).Value =
CDate(DropDownList.SelectedItem.Text)
CODE/
While it does update the tabel row with a portion of the data (for ex.. 9/28/2007 12:00:00). I don't need the date part of the data, because all I am interested in is the time. So when the time in the dropdownlist is 4:30:00 pm, I want that time to be retrieved. Any help is appreciated.
Thanks,
Phoenix
Hi,
Just format the date you retrieved from the dropdownlist using vbscript "FormatDateTime()" function and then update the table.
Let me inform if it does not work.
Thanks
Hi,
Just format the date you retrieved from the dropdownlist using vbscript "FormatDateTime()" function and then update the table.
Let me inform if it does not work.
Thanks
Thanks for responding...
I will try it, but is it in the form...
"FormatDateTime(hh:mm, variable_name)"?
In the meanwhile I tried ...
CODE..
Convert(Datetime,StartTime,108) from TableB
/CODE
.. didn't work. But I will give yours a shot. Let me know the syntax.
Thanks,
Phoenix
Thanks for responding...
I will try it, but is it in the form...
"FormatDateTime(hh:mm, variable_name)"?
In the meanwhile I tried ...
CODE..
Convert(Datetime,StartTime,108) from TableB
/CODE
.. didn't work. But I will give yours a shot. Let me know the syntax.
Thanks,
Phoenix
Hi
The code is; - FormatDateTime(date, format)
"format" takes parameters: 0, 1, 2, 3, 4.
"3" for hh:mm:ss
"4" for hh:mm
You just choose the parameter you want format your date.
...
Phoenix
I thought ASU was in Tempe. Hmm... Pheonix?
Anyway, welcome to the Scripts Developer Network. Notice that there is a button provided (marked - # -) that puts your code within a code block.
Jared
I thought ASU was in Tempe. Hmm... Pheonix?
Anyway, welcome to the Scripts Developer Network. Notice that there is a button provided (marked - # -) that puts your code within a code block.
Jared
Yes, ASU is in Tempe, but I live in Phoenix... about a couple of miles from school.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: andrew lowe |
last post by:
Hi,
Please bear with me on this problem, first I'll give you some background:
I have an object that contains a DateTime field which i pass to a webservice
public class Foo {
public DateTime...
|
by: Sterling Ledet |
last post by:
I am trying to create a web service that takes a string from my web server
in the following format:
Mon, 6 Oct 2003 18:39:47 UTC
and put's in a datetime so it can then be reformatted in C# as...
|
by: Ata İsmet Özçelik |
last post by:
Hi there,
I have a problem with the DateTime picker.. I want to use my custom
format; for this I can give a string for the format.But My goal is to
have the month name in the box in upper case...
|
by: niju |
last post by:
Hi there
I am trying to get a single digit hour in 12-hour format with the
following code.
DateTime hr = DateTime.Now;
string hour = hr.ToString("h");
However, I get "Input string was not in...
|
by: Reny J Joseph Thuthikattu |
last post by:
Hi,
I have a variabe in the format of 'DD-MON-YYYY HH:MI AM' .I want to add a
miniute to it.How can i do that?
by manipulation i want to make '01-JUNE-2004 11:59 PM' to '02-JUNE-2004
12:00 AM'...
|
by: Ugur Ekinci |
last post by:
Hi ,
I have two Sql Server 2000 on seperate machines ,
First one accepts datetime format like ("dd.MM.yyyy hh:mm:ss")
And Second one accepts datetime format like ("MM.dd.yyyy hh:mm:ss")
1-...
|
by: Simon Harvey |
last post by:
Hi all,
I'm having a bit of a problem working with dates. My computer is british,
but I'm developing an american application so I therefore need to use american
dates. But I can't get my...
|
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= |
last post by:
Hi
I am having a problem formatting a string when the time is in format
hh.mm.ss - used in Europe
Parse seems ok when the date uses "/" or "." as seperator
but I get an exception when time...
|
by: =?Utf-8?B?UGFvbG8=?= |
last post by:
I have a SQL database table with rows in which the primary key is a DateTime
type (although I don't use the Time part). Have added numerous rows and now
want to delete one so I enter the date...
|
by: Sreenivas |
last post by:
Hi every one,
I need to compare to datetime values , done in
stored procedure.The input datetime parameter is in
dd/mm/yyyy hh:mm:ss AM/PM format ,the datetime values to be compared
are also...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |