Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Friday, March 30, 2012

Saving the time with the date

I have a calendar control on a page that is saving the date to a SQL Server 2005 table and this works fine; but how do I also save it with the current time? It is always saving as 12:00:00 AM.

Thanks for the help.

Check your calendar control properties because it probably is setup to display/send only date. In this case SQL server add dfault time for date which is 12 AM.
It should have options like date and time, date only, time only.

Thanks

|||

It seems odd you would use a date from a calendar and want the current time but...

DateTime DateOnly = new DateTime(2007, 5, 3);
DateTime RightNow = DateTime.Now;

// add current time to date

DateOnly = DateOnly.AddHours(RightNow.Hour);
DateOnly = DateOnly.AddMinutes(RightNow.Minute);
DateOnly = DateOnly.AddSeconds(RightNow.Second);

|||

This is an intranet application where our CSRs record incoming items and the time stamp needs to be with the record. I solved it by putting System.DateTime.Now() into a Session variable.

Thanks for the responses. Now if I can figure out my "Access is Denied" problem with ajax...

Monday, March 26, 2012

Saving Datetime to variable

Hi im working on a simple function. I have a table with two columns
(datetime) and I need to extract date rom one of them and time from another
one - and then to join it and save it in the variable (which is declered as a
datetime). Please, can somebody help me or advice another waz how to get it?
many thanks
CREATE function dbo.dej_rozdil (@.vz int, @.r int) returns char(100)
as
begin
declare @.in_date as varchar
declare @.in_time as varchar
declare @.in as char(100)
set @.in_date = ( select convert(varchar,pol1,102) from dbo.vzorky_osr where
kod=@.vz and rok=@.r )
set @.in_time = ( select convert(varchar,pol2, 108) from dbo.vzorky_osr where
kod=@.vz and rok=@.r )
set @.in = @.in_date +' '+ @.in_time
return @.ret
end
On Sun, 22 Jan 2006 06:14:02 -0800, pietro wrote:

>Hi im working on a simple function. I have a table with two columns
>(datetime) and I need to extract date rom one of them and time from another
>one - and then to join it and save it in the variable (which is declered as a
>datetime). Please, can somebody help me or advice another waz how to get it?
>many thanks
Hi Pietro,
Are these date and time columns stored as datetime or as char/varchar?
If the former, you might consider storing them together in one column.
If the latter, you might consider storing them as datetime (much better
integrity checks, much better possibilities for doing calculations) AND
consider storing them together in one column.

>CREATE function dbo.dej_rozdil (@.vz int, @.r int) returns char(100)
Why are you not returning a datetime? That's what you want to store the
combined value in, after all!

>as
>begin
>declare @.in_date as varchar
>declare @.in_time as varchar
Since you don;t specify length here, these variables are now defined at
the default length: varchar(1).

>declare @.in as char(100)
>set @.in_date = ( select convert(varchar,pol1,102) from dbo.vzorky_osr where
>kod=@.vz and rok=@.r )
>set @.in_time = ( select convert(varchar,pol2, 108) from dbo.vzorky_osr where
>kod=@.vz and rok=@.r )
The use of convert in this statement suggests that the columns are
already of the datetime datatype. All this converting from datetime to
string and back won't do your performance any good - and the fact that
you didn't choose one of the recommended formats means that you're not
even assured that this will never return unexpected results.
See below for some better suggestions.

>set @.in = @.in_date +' '+ @.in_time
>return @.ret
>end
Your choice to use a user-defined functions has some performance
implications as well. I am aware of the benefits of UDF for readability,
reuseability and documentation - but are you aware of the implications
on performance?
Anyway, I promised you some alternatives. The first alternative is what
you should use if pol1 and pol2 are defined as datetime or smalldatetime
columns:
DECLARE @.result datetime -- or smalldatetime
SET @.result = (SELECT DATEADD(ms, DATEDIFF(ms, '0:00', pol2), pol1)
FROM dbo.vzorky_osr
WHERE kod = @.vz
AND rok = @.r)
The second alternative is what you should use if ALL of the following
conditions are met:
* pol1 and pol2 are both char or varchar
* pol1 is formatted yyyy-mm-dd
* pol2 is formatted hh:mm:ss or hh:mm:ss.mmm (where .mmm denotes the
milliseconds)
DECLARE @.result datetime -- or smalldatetime
SET @.result = (SELECT CAST(pol1 + 'T' + pol2 AS datetime) -- or
smalldatetime
FROM dbo.vzorky_osr
WHERE kod = @.vz
AND rok = @.r)
If col1 and col2 are (var)char but not in the format noted above, you
can either
a) use string manipulation to build a yyyy-mm-ddThh:mm:ss[.mmm] format
from whatever the current format is, or
b) concatenate them anyway, then use CONVERT with a style parameter to
ensure that SQL Server can't misinterpret the format.
Example for b:
CAST ('3/4/5' AS datetime) is dangerous, because is can be interpreted
as 3rd of april 2005, of march 4, 2005, 2003, april 5 or m,aybe yet
something else
CONVERT(datetime, '3/4/5', 11) is unambitious, since the style parameter
11 says that the japanese format (yy/mm/dd) is used.
If you need further help, then you'll have to provide more information.
See www.aspfaq.com/5006 for that.
Hugo Kornelis, SQL Server MVP

Friday, March 23, 2012

Saving date problem

I get the following error when I try to save a date:

When converting a string to DateTime, parse the string to take the date before putting each variable in the DateTime object.
I was using a calendar control thinking that might have been the problem so I am using just a text box for entry. In the ASP code for the Insert statement, I have this:

<asp:controlParameterName="InDate"Type="DateTime"ControlID="txtInDate"/>

I have double checked the SQL table to make sure that the field is DateTime and it is. Also, if I have not selected a date or the textbox contains no information then it does not error and just saves the field blank.

What do I need to do to store this date?
Thanks for the information.

It's missing the attribute PropertyName="Text" I believe.|||Nope, that wasn't it. And the calendar control does not have a "text" property so I changed it to PropertyName="SelectedDate" and then I still get the same error.

Saving date into SQL

Hi,

I want to save date into SQL server pls help me how to save this date into server. its give me syntax error that converting datetime to character string. and also I want to save date only in mm/dd/yy format in a sql not including time.

The following code I am using

sub SaveEvent(sender as object, e as EventArgs)

Dim dt As DateTime = DateTime.Parse(eventdate.Text)


lbl.text=dt
dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")

dim cmd as new SQLCommand("insert into events values('" & dt & "','" & desc.text & "')",con)

con.open()

cmd.executenonquery()

con.close()


end sub

Going thru your code, I am not sure what you are trying to do here. You have dt as a DateTime object. You cannot assign an object to lbl.Text, like in lbl.Text = dt. Now to the date problem in SQL Server. What you are probably trying to do is insert a DateTime value in a char type field in SQL Server table, and thus the reason for error. You have two choices, you either use a DateTime field in SQL Server or you don't. If you don't, you could try using a varchar type, but I am not sure, but if you use DateTime type, there is no way to trim the Time part in the value saved, though you can trim it while displaying it, either in SQL or your front end.

P.S.: Using other types to store datetime in SQL Server is not a good idea.

|||

Actually I get the date in textbox using <asp:TextBox> in this format(mm/dd/yy) and this textbox value I want to save in a SQL database, so regarding this how to save in the SQL.

|||

and i have also a datetime field in a sql database

|||

Which line is it giving you error again? Also, can you please post the exact error message?

|||I got this error and also below the whole code I am using.....

Server Error in '/' Application.

Syntax error converting datetime from character string.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Syntax error converting datetime from character string.

The following code is below:

<script runat="server">

sub SaveEvent(sender as object, e as EventArgs)


dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")

dim cmd as new SQLCommand("insert into events values('" & eventdate.text & "','" & desc.text & "')",con)

con.open()

cmd.executenonquery()

con.close()


end sub


</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>


<style type="text/css">

#display_prod{float:left;}

#prod{margin-top:0;}

</style>

</head>
<body>

<table border="1" align="center" cellpadding="5" cellspacing="0">
<tr>
<td valign="top">

<!--#include file = "header.aspx" -->
<!--#include file = "scroll.aspx" -->


<form id="prod" runat="server" enctype="multipart/form-data">
<table id="display_prod" width="554" border="1" cellspacing="0" cellpadding="0" align="left" height="400">
<tr valign="top">
<td>
<table border="1" align="center" cellpadding="20" cellspacing="0">
<tr>
<td>PRODUCTS DESCRIPTION <asp:Label runat="server" ID="lbl"></asp:Label></td>
</tr>
</table>

<table align="left" id="menu" width="150" border="1" cellpadding="0" cellspacing="0">
<tr align="center">

<td><a href="http://links.10026.com/?link=home.aspx">Main</a></td>
</tr>
<tr align="center">
<td><a href="http://links.10026.com/?link=Events.aspx">Change Password</a></td>
</tr>
<tr align="center">
<td><a href="http://links.10026.com/?link=Comments.aspx">Events</a></td>
</tr>
</table>


<table width="390" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100" >Enter Date :</td>
<td width="243" ><asp:TextBox runat="server" ID="eventdate" BackColor="#FFFFFF" Width="100"></asp:TextBox> mm/dd/yy</td>
</tr>
<tr>
<td>Description :</td>
<td><asp:TextBox runat="server" ID="desc" TextMode="MultiLine" Columns="20" Rows="3" BackColor="#FFFFFF" MaxLength="200"></asp:TextBox> max 200</td>
</tr>
<tr>
<td> </td>
<td>
<asp:Button runat="server" ID="submit" Text="Save" OnClick="SaveEvent"></asp:Button>
<asp:Button runat="server" ID="reset" Text="Reset"></asp:Button>
</td>
</tr>
</table>
</td>
</tr>
</table>

</form>

|||

I am assuming your eventdate.Text is supposed to have date in mm//dd/yy format and you are trying to insert that value in a datetime field in SQL Server table. If this is the case, use DateTime.Parse(eventdate.Text).

|||

Its again give me this error

Syntax error converting datetime from character string.

using this code:

dim cmd as new SQLCommand("insert into events values('" & DateTime.Parse(eventdate.text) & "','" & desc.text & "')",con)

|||

Here are few things I would like to know:
1. What exactly did you try to insert? Post the exact value that you typed in your textbox.

2. What is the structure of your table? What columns are there, in which order and their datatypes?

|||

The value of textbox is "02/11/07"

and below is a query which I use for table.

create table events
(
event_id integer primary key identity(1,1),
event_name varchar(200),
event_date datetime,
)

|||

Heres the first problem. The order in which you are inserting your values is different from the column order. Either name the columns like this INSERT INTO TABLE(Column1, Column2) VALUES(VALUE1, VALUE2) or use the values in order. From your table schema, the date part should be at the end.

|||

Thanks a lot I have solved my problem....

Cheers!

|||

one thing more that when I run this grid its give me show the this type of format 02/11/2007 00:00:00 and I want to display only dd/mm/yy can you pls tell me that how I can change the format?

<asp:DataGrid runat="server" ID="ViewEvents" AutoGenerateColumns="false">
<columns>
<asp:TemplateColumn>
<itemtemplate>
<table id="tt" border="1" cellpadding="5" cellspacing="0">
<tr>
<td>hello hwo r u<asp:Label runat="server" ID="eventname" Text='<%#container.DataItem("event_name")%>' ></asp:Label></td>

<td><asp:Label runat="server" ID="pdesc" Text='<%#container.DataItem("event_date")%>' ></asp:Label></td>
</tr>
</table>
</itemtemplate>
</asp:TemplateColumn>
</columns>
</asp:DataGrid>

|||

See if this helps, change the date format accordingly.

http://peterkellner.net/2006/05/24/how-to-set-a-date-format-in-gridview-using-aspnet-20using-htmlencode-property/

I would also recommend marking the posts as answers if they solved your problem.

Tuesday, March 20, 2012

Save time in Script Component which is almost forwarding

Hi,
I have to add the fields coming from the source AS IS but, I need to add current date as a column to it. So, What I do is to add an Script Component and add each and every output column in that along with defining their types and writing an "assignments" script.

Is there any possibility for me to save time in the scenarios where I am almost passing on the information to next level in the data flow ?

Any input regarding this will sincerely be appreciated.

FahadWhy can't you use a derived column transformation with getdate() as an expression? Using a derived column, you can add a new date column to your data flow.|||Thanks, I appreciate it.

Monday, March 12, 2012

Save only the date in a datetime field

Hello. A question please. Can I save only the date in a datetime field ? I don't want the hours.

Do you are using .NET? Use System.DateTime.Today instead of System.DateTime.Now.

Do you want a TSQL form to obtain only the date?

This is more complex:

Create a Function such as this:

create function DateOnly(@.date as datetime )

returns datetime

as

begin

return cast(CONVERT(CHAR(8),@.date, 112) as datetime)

end

Then use it in the following form:

update mytable set mydate = dbo.DateOnly(getdate()) where id = @.id

or

select dbo.DateOnly(getdate()) as onlythecurrentdate

Regards,

|||

My recommendation is to save the [Time] value.

You can ignore it for your current reporting needs, and if you even in the future decide to use the [Time] value, it will be in the database. (Business needs do often change. Adding [Time] values to existing data will, most likely, be impossible.

|||

Not really. Using any of the intrinsic date datatypes, you will always have the time portion being stored. But, the default time is midnight, so it is common practice to just store date information by making sure to only pass in the date portion, and you can basically ignore the time.

If you don't trust users and the other programmers to get it right (and who does :) then you could put an instead of trigger on tables with dates to make sure (which I would actually do, if you have an automated way to build code, like data modeling tools, or simply using system metadata)

|||

As previously stated the Date types in SQL will save the hours, etc. But, you can can remove them from the date so they are all teh same (as is 00:00:00.000)

One method was shown above to CONVERT the date. Another is to do date math:

SELECT DATEADD(D, 0, DATEDIFF(D, 0,GETDATE()))

Cheers

|||

As mentioned in this thread, there is no date only data type in SQL Server. So even if you don't specify the time part, SQL Server will default the value to 12:00 AM for any smalldatetime/datetime value. You can use convert or date arithmetic etc but there is not that much point since you will have to remember to do the same for any value that is compared against the column anyway. So just save the value as is and ignore the time part in the WHERE clause. This is more efficient to do and there are easy ways to write the conditions using lower/upper bound checks.

Another option that is commonly used in data warehouses is to have a date dimension table or calendar table in your database that has an integer key. You can then use this key in your tables. This provides lot of flexibility and storage benefits too since you can represent date values more compact. This does require additional join to date table but the benefits far outweigh the advantages in data warehouse environments. This is not suitable for OLTP environments but it is not uncommon to use such techniques there too. It depends on your database design and application needs.

Save job results to a file minus header information

sql server 2005
There is a job that returns a date.The goal is to have a flat file of
dates with no header information.
Is there a way to do this in sql server or you have to find DOS scripts
to clean that out...How are you causing the output to the file? osql? sqlcmd? Job step output?
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Massa Batheli" <mngong@.gmail.com> wrote in message
news:1162987757.059162.108050@.b28g2000cwb.googlegroups.com...
> sql server 2005
> There is a job that returns a date.The goal is to have a flat file of
> dates with no header information.
> Is there a way to do this in sql server or you have to find DOS scripts
> to clean that out...
>|||I have the same question,
"Save job results to a file minus header information "
with the following exception. I am using SQL 2000
I am scheduling a stored proc to run using SQL Server Agent.
"Arnie Rowland" wrote:

> How are you causing the output to the file? osql? sqlcmd? Job step output?
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to th
e
> top yourself.
> - H. Norman Schwarzkopf
>
> "Massa Batheli" <mngong@.gmail.com> wrote in message
> news:1162987757.059162.108050@.b28g2000cwb.googlegroups.com...
>
>|||Sorry guys failed to update this
Regular internal sql server job that writes to a flat file ...
Thanks for your time
Massa|||Your Job step could direct output to a file,
OR the Job step itself could shell out to OSQL and allow OSQL to direct
output to a file.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Massa Batheli" <mngong@.gmail.com> wrote in message
news:1163703951.849624.192880@.h54g2000cwb.googlegroups.com...
> Sorry guys failed to update this
> Regular internal sql server job that writes to a flat file ...
> Thanks for your time
> Massa
>

Save job results to a file minus header information

sql server 2005
There is a job that returns a date.The goal is to have a flat file of
dates with no header information.
Is there a way to do this in sql server or you have to find DOS scripts
to clean that out...How are you causing the output to the file? osql? sqlcmd? Job step output?
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Massa Batheli" <mngong@.gmail.com> wrote in message
news:1162987757.059162.108050@.b28g2000cwb.googlegroups.com...
> sql server 2005
> There is a job that returns a date.The goal is to have a flat file of
> dates with no header information.
> Is there a way to do this in sql server or you have to find DOS scripts
> to clean that out...
>|||I have the same question,
"Save job results to a file minus header information "
with the following exception. I am using SQL 2000
I am scheduling a stored proc to run using SQL Server Agent.
"Arnie Rowland" wrote:
> How are you causing the output to the file? osql? sqlcmd? Job step output?
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the
> top yourself.
> - H. Norman Schwarzkopf
>
> "Massa Batheli" <mngong@.gmail.com> wrote in message
> news:1162987757.059162.108050@.b28g2000cwb.googlegroups.com...
> > sql server 2005
> > There is a job that returns a date.The goal is to have a flat file of
> > dates with no header information.
> > Is there a way to do this in sql server or you have to find DOS scripts
> > to clean that out...
> >
>
>|||Sorry guys failed to update this
Regular internal sql server job that writes to a flat file ...
Thanks for your time
Massa|||Your Job step could direct output to a file,
OR the Job step itself could shell out to OSQL and allow OSQL to direct
output to a file.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Massa Batheli" <mngong@.gmail.com> wrote in message
news:1163703951.849624.192880@.h54g2000cwb.googlegroups.com...
> Sorry guys failed to update this
> Regular internal sql server job that writes to a flat file ...
> Thanks for your time
> Massa
>

Save job results to a file minus header information

sql server 2005
There is a job that returns a date.The goal is to have a flat file of
dates with no header information.
Is there a way to do this in sql server or you have to find DOS scripts
to clean that out...
How are you causing the output to the file? osql? sqlcmd? Job step output?
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Massa Batheli" <mngong@.gmail.com> wrote in message
news:1162987757.059162.108050@.b28g2000cwb.googlegr oups.com...
> sql server 2005
> There is a job that returns a date.The goal is to have a flat file of
> dates with no header information.
> Is there a way to do this in sql server or you have to find DOS scripts
> to clean that out...
>
|||I have the same question,
"Save job results to a file minus header information "
with the following exception. I am using SQL 2000
I am scheduling a stored proc to run using SQL Server Agent.
"Arnie Rowland" wrote:

> How are you causing the output to the file? osql? sqlcmd? Job step output?
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the
> top yourself.
> - H. Norman Schwarzkopf
>
> "Massa Batheli" <mngong@.gmail.com> wrote in message
> news:1162987757.059162.108050@.b28g2000cwb.googlegr oups.com...
>
>
|||Sorry guys failed to update this
Regular internal sql server job that writes to a flat file ...
Thanks for your time
Massa
|||Your Job step could direct output to a file,
OR the Job step itself could shell out to OSQL and allow OSQL to direct
output to a file.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"Massa Batheli" <mngong@.gmail.com> wrote in message
news:1163703951.849624.192880@.h54g2000cwb.googlegr oups.com...
> Sorry guys failed to update this
> Regular internal sql server job that writes to a flat file ...
> Thanks for your time
> Massa
>

Friday, March 9, 2012

Save a time value in a column

Hi all!
What is the best way to save a time value (not the date) in a column
of a SQL Server 2005 database?
Thanks in adavance.
--
Marco Minerva, marco.minerva@.gmail.com
http://blogs.ugidotnet.org/marcomHi
CREATE TABLE #t (t CHAR(8))
INSERT INTO #t SELECT CONVERT(CHAR(10),GETDATE(),108)
SELECT * FROM #t
<marco.minerva@.gmail.com> wrote in message
news:1193742138.605341.4690@.k79g2000hse.googlegroups.com...
> Hi all!
> What is the best way to save a time value (not the date) in a column
> of a SQL Server 2005 database?
> Thanks in adavance.
> --
> Marco Minerva, marco.minerva@.gmail.com
> http://blogs.ugidotnet.org/marcom
>|||On Tue, 30 Oct 2007 04:02:18 -0700, marco.minerva@.gmail.com wrote:
>Hi all!
>What is the best way to save a time value (not the date) in a column
>of a SQL Server 2005 database?
>Thanks in adavance.
SQL Server 2008 is to have a time datatype, but that doesn't help you
now. Today there are no good ways, just a variety of ways with
shortcomings.
Use a datetime with a specific date (1 January 1900 for example) that
has to be ignored by the application.
Use a number and store the number of milliseconds (or seconds, as
required) from midnight and convert as required.
Use a string.
I would tend toward the datetime with a constraint on the date, PLUS a
derived column that returns the time as a string using CONVERT with
style 114: CONVERT(char(12),colname,114).
Roy Harvey
Beacon Falls, CT|||On 30 Ott, 12:30, "Roy Harvey (SQL Server MVP)" <roy_har...@.snet.net>
wrote:
> On Tue, 30 Oct 2007 04:02:18 -0700, marco.mine...@.gmail.com wrote:
> >Hi all!
> >What is the best way to save a time value (not the date) in a column
> >of a SQL Server 2005 database?
> >Thanks in adavance.
> SQL Server 2008 is to have a time datatype, but that doesn't help you
> now. Today there are no good ways, just a variety of ways with
> shortcomings.
> Use a datetime with a specific date (1 January 1900 for example) that
> has to be ignored by the application.
> Use a number and store the number of milliseconds (or seconds, as
> required) from midnight and convert as required.
> Use a string.
> I would tend toward the datetime with a constraint on the date, PLUS a
> derived column that returns the time as a string using CONVERT with
> style 114: CONVERT(char(12),colname,114).
> Roy Harvey
> Beacon Falls, CT
Thanks to all!
--
Marco Minerva, marco.minerva@.gmail.com
http://blogs.ugidotnet.org/marcom