Formating String To Time

Apr 4, 2007

Hello,



I have the following question.

I have a report where i do a lot of time calculation

in one colomn i have values in seconds.

for example i have a total of 246 seconds

how can i format this to view as 00:04:06 or even 4 mins 6 secs



Vincent

View 6 Replies


ADVERTISEMENT

Formating A String In Sql

May 5, 2008

Ok so here is an explanation of what i need. I have a table that has emails in it. I need to get those emails to show up as verticle line of names. these will then be sent out via email so i have the following line of code to put them into a string:

select @emails1 = isnull (@emails1 + '; ','' + char(13))+ char(13) + email from emaillist

I have tried putting Char(13) in multiple areas trying to get line break. but the email sends the list in a straight line.

can anyone help me. also if you need more info let me know i will give it to you.

example of desired output
xxxx@dgfasg.com
sfgasg@asgahi.com
saghna@asogh.com

View 20 Replies View Related

FOrmating SQL DateType To String Format

Jun 11, 2008

I have the information below
PRINT REPLACE(REPLACE(CONVERT(varchar(50), GetDate()), ' ', ''), ':', '')
 What I would Like to do is run the query above  and get date of this type '2003-05-08 12:35:29.998'  returned as '20030508123529998'
I know GetDate does not even come up with date in the first format so I need to know which way to get it in the first format so that I can run the query and get the second format string returned to me. Thanks in Advance

View 4 Replies View Related

SQL 2012 :: Converting Time String In Temp Table To Military Time Then Cast As Integer?

Dec 26, 2014

I need to take a temporary table that has various times stored in a text field (4:30 pm, 11:00 am, 5:30 pm, etc.), convert it to miltary time then cast it as an integer with an update statement kind of like:

Update myTable set MovieTime = REPLACE(CONVERT(CHAR(5),GETDATE(),108), ':', '')

how this can be done while my temp table is in session?

View 2 Replies View Related

Convert String Into Sql Date Time

May 13, 2004

i have a sql statement that i created in code and it is sending a query to the database
when i dim the variable a datetime variable it says that it cant convert it
if i make the variable a varchar it works but it only returns one result when it should be returning about 10

here is the code


Public Function dbDGQSSearch(ByVal BatchID As String, ByVal CreatedBy As Integer, ByVal CreatedFor As Integer, ByVal DateCreatedMod As Integer, ByVal DateCreated As String, ByVal DateCompletedMod As Integer, ByVal DateCompleted As String, ByVal DateStartedMod As Integer, ByVal DateStarted As String, ByVal SearchType As Integer, ByVal Completed As Integer, ByVal PriorityMod As Integer, ByVal Priority As Integer, ByVal RemainingCallsMod As Integer, ByVal RemainingCalls As Integer, ByVal TotalCallsMod As Integer, ByVal TotalCalls As Integer, ByVal Bonus As Integer, ByVal Keyword1 As String, ByVal Keyword2 As String, ByVal Keyword3 As String, ByVal Keyword4 As String, ByVal Keyword5 As String)

Dim strQueSearch As String
strQueSearch = "SELECT tlkup_Rep.RepID, tlkup_Rep.PositionID, tlkup_Rep.RepFName, tlkup_Rep.RepLName, tlkup_Rep.RepPassword, tlkup_Rep.RepUserName, tlkup_Rep.RepFName + ' ' + tlkup_Rep.RepLName AS RepName, t_Que.QueID, t_Que.BatchID, t_Que.AdminID, t_Que.Manager, t_Que.BonusID, t_Que.QueCompleted, t_Que.QueDate, t_Que.QueNotes, t_Que.QuePriority, t_Que.QueQuantity, t_Que.QueStartDate, t_Que.Mail, t_Que.QueDateComplete, t_Que.QueTotal FROM t_Que INNER JOIN tlkup_Rep ON t_Que.Manager = tlkup_Rep.RepID AND t_Que.Manager = tlkup_Rep.RepID WHERE BatchID<>'' and BatchID<>'2' and BatchID<>'3' and BatchID<>'4' "


'Creates statement for selecting the add to batch data where the criteria appear
If BatchID <> "" Then

strQueSearch = strQueSearch + " and t_Que.BatchID= @BatchID "
End If
If CreatedBy > 1 Then
strQueSearch = strQueSearch + " and t_Que.RepID =@RepID "
End If
If CreatedFor > 1 Then
strQueSearch = strQueSearch + " and t_Que.Manager = @Manager "
End If

If DateCreated <> "" Then
If DateCreatedMod = 0 Then
'>
strQueSearch = strQueSearch + " and t_Que.QueDate >@QueDate "
ElseIf DateCreatedMod = 1 Then
'<
strQueSearch = strQueSearch + " and t_Que.QueDate <@QueDate "
ElseIf DateCreatedMod = 2 Then
'=
strQueSearch = strQueSearch + " and t_Que.QueDate =@QueDate "
End If
End If

If DateCompleted <> "" Then
If DateCompletedMod = 0 Then
'>
strQueSearch = strQueSearch + " and t_Que.QueDateComplete >@QueDateComplete "
ElseIf DateCompletedMod = 1 Then
'<
strQueSearch = strQueSearch + " and t_Que.QueDateComplete <@QueDateComplete and t_Que.QueDateComplete >'1/1/1900' "
ElseIf DateCompletedMod = 2 Then
'=
strQueSearch = strQueSearch + " and t_Que.QueDateComplete =@QueDateComplete "
End If
End If

If DateStarted <> "" Then
If DateStartedMod = 0 Then
'>
strQueSearch = strQueSearch + " and t_Que.QueStartDate >@QueStartDate "
ElseIf DateStartedMod = 1 Then
'<
strQueSearch = strQueSearch + " and t_Que.QueStartDate <@QueStartDate "
ElseIf DateStartedMod = 2 Then
'=
strQueSearch = strQueSearch + " and t_Que.QueStartDate =@QueStartDate "
End If
End If


If SearchType = 0 Then
'Both
'strQueSearch = strQueSearch + " and t_Que.Mail=0 and t_Que.Mail=1 "
ElseIf SearchType = 1 Then
'Mail
strQueSearch = strQueSearch + " and t_Que.Mail=1 "
ElseIf SearchType = 2 Then
'Phone
strQueSearch = strQueSearch + " and t_Que.Mail=0 "
End If

If Completed = 0 Then
'Both
'strQueSearch = strQueSearch + " and t_Que.Mail=0 and t_Que.Mail=1 "
ElseIf Completed = 1 Then
'Yes
strQueSearch = strQueSearch + " and t_Que.QueCompleted=1 "
ElseIf Completed = 2 Then
'No
strQueSearch = strQueSearch + " and t_Que.QueCompleted=0 "
End If

If Priority > 0 Then
If PriorityMod = 0 Then
'>
strQueSearch = strQueSearch + " and t_Que.QuePriority >@QuePriority "
ElseIf PriorityMod = 1 Then
'<
strQueSearch = strQueSearch + " and t_Que.QuePriority <@QuePriority "
ElseIf PriorityMod = 2 Then
'=
strQueSearch = strQueSearch + " and t_Que.QuePriority =@QuePriority "
End If
End If
If RemainingCalls > 0 Then
If RemainingCallsMod = 0 Then
'>
strQueSearch = strQueSearch + " and t_Que.QueQuantity >@QueQuantity "
ElseIf RemainingCallsMod = 1 Then
'<
strQueSearch = strQueSearch + " and t_Que.QueQuantity <@QueQuantity "
ElseIf RemainingCallsMod = 2 Then
'=
strQueSearch = strQueSearch + " and t_Que.QueQuantity =@QueQuantity "
End If
End If

If TotalCalls > 0 Then
If TotalCallsMod = 0 Then
'>
strQueSearch = strQueSearch + " and t_Que.QueTotal >@QueTotal "
ElseIf TotalCallsMod = 1 Then
'<
strQueSearch = strQueSearch + " and t_Que.QueTotal <@QueTotal "
ElseIf TotalCallsMod = 2 Then
'=
strQueSearch = strQueSearch + " and t_Que.QueTotal =@QueTotal "
End If
End If

If Bonus > 1 Then
strQueSearch = strQueSearch + " and t_Que.BonusID =@BonusID "
End If

If Keyword1 <> "" Then
strQueSearch = strQueSearch + " and t_Que.QueNotes like '%'+@Keyword1+'%' "
End If
If Keyword2 <> "" Then
strQueSearch = strQueSearch + " and t_Que.QueNotes like '%'+@Keyword2+'%' "
End If
If Keyword3 <> "" Then
strQueSearch = strQueSearch + " and t_Que.QueNotes like '%'+@Keyword3+'%' "
End If
If Keyword4 <> "" Then
strQueSearch = strQueSearch + " and t_Que.QueNotes like '%'+@Keyword4+'%' "
End If
If Keyword5 <> "" Then
strQueSearch = strQueSearch + " and t_Que.QueNotes like '%'+@Keyword5+'%' "
End If


'makes statement into sqlcommand
C.daQueSearch.SelectCommand.CommandText = strQueSearch



'var declaration
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@BatchID", SqlDbType.VarChar, 12))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@Manager", SqlDbType.Int))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@RepID", SqlDbType.Int))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@QueDate", SqlDbType.VarChar, 20)) '<--- This is what,when i change to datetime, says it cant convert
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@QueStartDate", SqlDbType.VarChar, 20))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@QueDateComplete", SqlDbType.VarChar, 20))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@QuePriority", SqlDbType.Int))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@QueQuantity", SqlDbType.BigInt))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@QueTotal", SqlDbType.BigInt))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@BonusID", SqlDbType.SmallInt))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@Keyword1", SqlDbType.VarChar, 50))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@Keyword2", SqlDbType.VarChar, 50))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@Keyword3", SqlDbType.VarChar, 50))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@Keyword4", SqlDbType.VarChar, 50))
C.daQueSearch.SelectCommand.Parameters.Add(New SqlParameter("@Keyword5", SqlDbType.VarChar, 50))

'data entry
C.daQueSearch.SelectCommand.Parameters("@BatchID").Value = BatchID
C.daQueSearch.SelectCommand.Parameters("@Manager").Value = CreatedBy
C.daQueSearch.SelectCommand.Parameters("@RepID").Value = CreatedFor
C.daQueSearch.SelectCommand.Parameters("@QueDate").Value = DateCreated
C.daQueSearch.SelectCommand.Parameters("@QueStartDate").Value = DateStarted
C.daQueSearch.SelectCommand.Parameters("@QueDateComplete").Value = DateCompleted
C.daQueSearch.SelectCommand.Parameters("@QuePriority").Value = Priority
C.daQueSearch.SelectCommand.Parameters("@QueQuantity").Value = RemainingCalls
C.daQueSearch.SelectCommand.Parameters("@QueTotal").Value = TotalCalls
C.daQueSearch.SelectCommand.Parameters("@BonusID").Value = Bonus
C.daQueSearch.SelectCommand.Parameters("@Keyword1").Value = Keyword1
C.daQueSearch.SelectCommand.Parameters("@Keyword2").Value = Keyword2
C.daQueSearch.SelectCommand.Parameters("@Keyword3").Value = Keyword3
C.daQueSearch.SelectCommand.Parameters("@Keyword4").Value = Keyword4
C.daQueSearch.SelectCommand.Parameters("@Keyword5").Value = Keyword5


Try
C.ndConnection.Open()
C.daQueSearch.SelectCommand.ExecuteNonQuery()
Catch ex As Exception
lblMainError1.Text = err("dbDGQSSearch " + ex.Source, ex.Message, CurUsr)
lblMainError1.Visible = True
Finally
C.ndConnection.Close()
End Try

FillQSDG()' this fills the datagrid


End Function

View 8 Replies View Related

First Time Writing, String Manipulation??

Mar 5, 2007

I'm hoping someone can help! Im using sql2000, and I am attempting to capitalize every 1st letter of a word in a column.

For Example:
"GOLF IS FUN,BOWLING IS GREAT"

What Id like to get as my results:

"Golf is fun, Bowling is great"


Trying to figure out the syntax to get the character after the comma to have a space then capital "B" Thought I could use a charindex but just cant seem to get it.

View 4 Replies View Related

Convert Date And Time To String?

Apr 16, 2004

Hi,

Can anyone tell me how to convert date and time to string.

I got one field inside my database which contain data like below:

4/16/2004 10:19:01 AM

if i wan to call out a record which have to refer to the data above

Select *
From table_A
where field_date= ???????

what to fill in the ??????

Thanx

View 3 Replies View Related

Strip Time From Date String

Apr 23, 2008

stupid question - how do I strip the time portion from a date returned from now() or

Globals!ExecutionTime.

I MS either used consistent date functions across all platforms or include help in BOL for their VB functions in SSRS.....

View 5 Replies View Related

SQL Server 2012 :: String To Date Without Time

Sep 15, 2015

I have string as '1-12-2012', i wanted to convert it into date as format '2012-12-01'. I used the function as cast('1-12-2012' as Date) it's working but for a set of values where Null occurs it gives error as conversion failed when casting date and/or time from character string.

View 5 Replies View Related

Converting Date And / Or Time From Character String

Oct 22, 2013

My Query is as shown below

Declare @FROMDATE DATETIME
Declare @THRUDATE DATETIME
Declare @Parm Varchar(250)
set @FROMDATE = '09/25/2013'
set @THRUDATE = '09/28/2013'
set @Parm = 'FROMDATE=' + @FROMDATE + ';THRUDATE=' + @THRUDATE

I am getting an error at above line saying that

Conversion failed when converting date and/or time from character string.

View 8 Replies View Related

How Do I Convert As/400 Time Field Being Seen As Dt_I8 To String

Apr 4, 2008



I am struggling getting a time field from as/400 into SQL 200 using SSIS. The time field for some reason is being seen as dt_I8, And every type of conversion I try to do with it, it gives me an error about truncation. Example of my time field 12.35.00

How do you convert time field from as/400 which sql is seeing as DT_I8 to a string so that I can combine it with a date field to put it into a database timestamp field.
Stacy

View 10 Replies View Related

Convert The Format Of A Date Time String Transformation....

Jul 27, 2004

Im working with a breaking system and I wont to convert the (FROM) datetime column to accept just time like (4:00:00 AM) without the date (7/23/2004) but it doesn’t have column format like the access ??
I found something in the SQL help :

How to convert the format of a Date Time String transformation (Enterprise Manager)
To convert the format of a Date Time String transformation
1.On the Transformations tab of the Transform Data Task Properties or Data Driven Query Task Properties dialog box, click the Source column containing the date or time to be modified, and then click the Destination column where you want the modified string to be placed.
2.Do one of the following:
•If there is a mapping arrow connecting the two columns, click Delete, and then click New.
•If there is no mapping arrow, click New.
3.In the Create New Transformation dialog box, click DateTime String.
4.Click the General tab, and then click Properties.
5.In the Date Format list, select the format you want.
6.Click Naming to display the Calendar Names dialog box, where you can select long or short day or month names and the A.M. and P.M. designators you want.
7.In the Language list, select the language you want, and then click Set Language Defaults.
But unfortunately I didn't find the "Transformations tab" I look a lot in the SQL Enterprise Manager

Do anybody work with the Transformations or at least know where is it please ???

View 1 Replies View Related

Get Flat File Source Connection String At Run Time

Apr 12, 2007

I have a simple package, which reads a flat file source, does some transformation, and outputs to a flat file destination. The package runs as a SQL Agent job, so I have the flat file source and OLEDB connection ticked and configured on the data sources tab.

What I would like to do is get hold of the flat file source connection string property from inside the package at run time, and use it to set the flat file destination connection string using property expressions.

The easy option is to set the destination in the agent job, but I'd like to add a date/time stamp to the destination filename.

Is this possible?

Thanks,

Greg.

View 1 Replies View Related

Integration Services :: How To Derive String To Date-time

Jul 15, 2015

How to derived string to date-time (dd/mm/yyyy)

Input Date :

Start Date 
15/06/2015
30/06/2015
NULL
2015/06/24

Some date are in format dd/mm/yyyy I want to keep them as it is , but I want to convert the NULL one and 2015/06/24 to 24/06/2015.

View 3 Replies View Related

Connection String Has To Be Reset Every Time When DTS Package Is Started

Mar 31, 2006

Hi All,

I am trying to import data from flat file to sql server 2005 DB table using SSIS. There are 4 different text files in the input folder. I am using for loop to iterate reading and importing 4 times. In order to do this I have set "Connection String" property of a connection manager to a package level variable using expression. There is a script which supplies the source file name and assigns to this variable.

The package works fine. The data gets imported successfully into the destination table. However, when I close the package, reopen it and then run, the Data Flow task fails with the error "Can not open the source file". If I enter a valid file name in the Flat File Source task and run the package it works again. As soon as I close the file/package, reopen and then run, the data flow task fails with the same error.



How do I make this working. I am planning to schedule a job which will execute the package programatically. In that case no user intevention is possible.

I would appreciate your help on this. I can provide further details if required.

-SGK



View 13 Replies View Related

Convert Date Time(string Format) To Database Timestamp

Apr 3, 2008

I have two fields DSRHADTI which is an isodate and DSRHTIME which is 8 char time field in format 10.31.00. I want to take both these fields and put them into a field that is database timestamp so I have converted DSRHDATI to 10 character field. I am then trying to use substring to put both into 18 character field using derived column transformation editor. but it does not like the below. It's red syntax error what am I missing.

(SUBSTRING(Copy of DSRHDATI,1,4) +' /' + SUBSTRING( Copy of DSRHDATI,6,2) + '/ ' + SUBSTRING(Copy of DSRHDATI,9,2)) + SUBSTRING(DSRHTIME,1,2) + '.' + SUBSTRING(DSRHTIME,4,2) + '.' + SUBSTRING(DSRHTIME,7,2)

One I get the above to work I plan on convert 18 char to datetimestamp.

Am I on the right track on how to do this?

View 16 Replies View Related

CURSOR - Conversion Failed When Converting Date And / Or Time From Character String

May 15, 2015

This is my code and I don't know why this error keeps coming out : PS : I did cursor to execute query.Th error showed is bold:

DECLARE RegCreatedDate CURSOR FOR
SELECT DISTINCT (CONVERT(NVARCHAR,CreatedDate,103)) 
FROM CA_Registration WHERE Month(CreatedDate)= @paMonthIn AND YEAR(CreatedDate)=@paYearIn
OPEN RegCreatedDate
FETCH NEXT FROM RegCreatedDate INTO @RegCreatedDate
WHILE @@FETCH_STATUS = 0

[Code] ....

View 9 Replies View Related

Select Only - Conversion Failed When Converting Date And / Or Time From Character String

Sep 4, 2015

I'm trying to select only July from show_held but I keep on getting the error message saying:

Conversion failed when converting date and/or time from character string.

I get error message after I write this code:

ANDshow.show_held = '&July&'

As you can see from the below code, How do I select July from times_held_in_July?

SELECTevent_name,
DATENAME (MONTH, show_held) AS times_held_in_July
FROMevent,
show
WHEREevent.show_id = show.show_id

Result:

event_name times_held_in_July
DressageJuly
Jumping July
Led in July
Led in September
Led in May
DressageApril
DressageJuly
Flag and PoleJuly
SELECTevent_name,
DATENAME (MONTH, show_held) AS times_held_in_July
FROMevent,
show
WHEREevent.show_id = show.show_id
ANDshow.show_held = '&July&'

Result:

Msg 241, Level 16, State 1, Line 24

Conversion failed when converting date and/or time from character string.

View 6 Replies View Related

DB Design :: Conversion Failed When Converting Date And / Or Time From Character String

Sep 14, 2015

BEGIN TRAN;
INSERT INTO [dbo].[QuestManualProcess]
           ([ProcessFromDate]
           ,[LastProcessedFileDateStamp]
           ,[ProcessedOnDate]
           
[code]....

Conversion failed when converting date and/or time from character string/

View 4 Replies View Related

DateTime Formating.

Oct 5, 2006

I am trying to query a calendar table that has the [start] datetime of an event and then a [title] of the event. I am trying to display them as;* 8:00 AM Get to work* Independance daysome of the events have a start time and some only have a date. the ones that do not have a start time have a start time of 12:00:00 How do I query the two fields and only show the start time & title of the events that have a start time and just the title for the ones that do not have a start time.. I've tried this...select Event = (CONVERT(CHAR(8),start,8) +' ' + title) from Calendar where CONVERT(CHAR(8),start,8) <> '12:00:00'It does display the start and event title but only for the ones that have a start time. And how do I get the 8:00 AM format for the time? Thanks for any help.Mark

View 3 Replies View Related

FORMATING THE SQL OUTPUT

May 17, 2001

Hi!

I have couple of questions. Anybody can help me.

1. How can I format the output in T-SQL coming like as one can do in SQL*PLUS (ORACLE)?

2. I decalerd a Cursor and using that It is generating the output. I jut want to dispaly only 100 rows, its mean that I want to control the output.

Please give your feedback

View 1 Replies View Related

Formating Date

Aug 6, 2002

How do I get the following format using SQL server ( SQL QUERY ??)
yymmddhh.

In Oracle I can do simple...

Select to_char(datecolumn, 'YYMMDDHH') from tablename;

RESULT > 02080603
-- YEAR, MONTH, DATE, HOUR.

What is that I need to do to get the same result on sql server.?

tks

View 1 Replies View Related

Text Formating

Nov 9, 2006

i have this:
\FILInternalBuisnessArea*.*
\FILInternalBuisnessArea
\FILInternalBuisnessArea*.qvw
\FILInternalBuisnessArea empfileDB.mdb
\FILInternalPublic Area*.*
\FILInternalPublic Area
\FILInternalPublic Area*.xls
\FILInternalPublic Areaacro*.doc
\FILInternalPublic Areaeconomi*.xls
\FILInternalPublic AreaeconomiGroup01FileToSave*.xls
\FILInternalPublic AreaeconomiGroup01Unit01FileToSave*.xls

And i want to strip away whatever is after the last '' so the output should look like this
\FILInternalBuisnessArea
\FILInternalBuisnessArea
\FILInternalBuisnessArea
\FILInternalBuisnessArea
\FILInternalPublic Area
\FILInternalPublic Area
\FILInternalPublic Area
\FILInternalPublic Area
\FILInternalPublic Areaeconomi
\FILInternalPublic AreaeconomiGroup01
\FILInternalPublic AreaeconomiGroup01unit01

datatype = varchar (500)

thx alot in advance

//Mr

View 7 Replies View Related

Formating The Record

Apr 7, 2008

Hi all,
i am using sql server 2005.
let me explain the scenario.
I have to built a report where I have to find out no of call made by an executive to a perticular customer during a year

my table record look like

empid custid product date and other field
em111 iimran aaaa 01-04-2008 ........
em111 iimran bbbb 01-04-2008 ........
em111 iimran cccc 01-04-2008 ........
em111 xxxxxx aaaa 01-04-2008 ........
em111 xxxxxx 2222 01-04-2008 ........
em111 iimran aaaa 02-04-2008 ........
em111 iimran bbbb 02-04-2008 ........
em111 iimran cccc 02-04-2008 ........
em111 xxxxxx aaaa 02-04-2008 ........
em111 xxxxxx 2222 02-04-2008 ........

.
problem is it has to implement in this manner

Srno custname jan feb mar apr may june july aug sep oct nov dec
1 iimran 0 4 0 5 6 7 0 3 5 7 3 1

please suggest some idea.


Please Help

View 1 Replies View Related

Formating Problem

Dec 18, 2007

hi all
can anybody tell me how to get double underline for the text box value in reporting services
am using sql server reporting services 2000

View 3 Replies View Related

Condtional Formating

Oct 26, 2007



Hi all,

This expression gives me an error anyone know why?


=IIF(Fields!M.Value = 0,"Average",(MonthName(Fields!M.Value)))

Thanks

View 4 Replies View Related

Drill Down Formating

May 22, 2006

Does anyone know what code I'd use in an expression to conditionally format based on if the drill down is expanded or collapsed?

Thanks.

in an
in-an
inane
Inna
Ian
Edit...
Revert to "inan"conditionally
conditional
conditionals
conditionality
Edit...
Revert to "conditionaly"

View 3 Replies View Related

Formating Datetime

Mar 14, 2008

I have a decimal time field that I would like to convert to "hh:mms"

If I try to use =cdate(Fields!Avg_Visit_Duration.Value) I get #Error in my result. The error message is:

Conversion from type 'Double' to type 'Date' is not valid.

0.0044612654 should be shown as 00:06:25. I can do this very easy in SSAS or Excel... SSRS is giving me fits.

edit: made question clearer. nlm

View 5 Replies View Related

Record Count - Conversion Failed When Converting Date And / Or Time From Character String

Sep 26, 2014

I am trying to write a stored procedure that loops through the list of user tables, gets the record count for each one and write a record to an audit table with DATE, TABLENAME, RECORDCOUNT.I keep getting an error "Conversion failed when converting date and/or time from character string".Here is the script...

DECLARE @table nvarchar(500)
DECLARE @sql nvarchar(520)
DECLARE CursorSelect CURSOR FOR
select table_name from INFORMATION_SCHEMA.tables where table_name not like 'sys%' order by table_name

[code]....

View 2 Replies View Related

Transact SQL :: Error - Conversion Failed When Converting Date And / Or Time From Character String

Nov 16, 2015

I've imported a CSV file into a table in SQL Server 2012. It's a large file, 140,000+ rows, so I couldn't covert it to Excel first to preserve the date format due to Excel's row limit. In the CSV file, there were 3 column with date data in "31-Aug-09" format, and the import automatically transformed these in "31AUG09" format (varchar(50)) in SQL Server.  Now I need to convert these 3 columns from varchar to datetime so I could work with them in date format.

I've tried several things,e.g,

select
convert(datetime,
right(admdate,4)+left(admdate,2)+substring(admdate,3,3))

or

select
convert(datetime,
substring(admdate,6,4)+substring(admdate,1,2)+substring(admdate,3,3))

but keep getting the same error message (Msg 241) "Conversion failed when converting date and/or time from character string".

View 4 Replies View Related

Integration Services :: SSIS Is Removing Leading Zeroes From 6 Character Time String?

May 29, 2015

I am using SSIS 2012 SP1 to import a comma delimited csv file into a SQL table.

One of the fields carries a time value:

Source = textfile, column=DT_STR(8), value format = "hhmmss", e.g. "011525"
Destination = field in SQL table, data type = time(0)

To get it from the textfile to the SQL table I am:

1.) Creating a derived column called [d_Time of Entry]with the following formula -

SUBSTRING([Time of Entry],1,2) + ":" + SUBSTRING([Time of Entry],3,2) + ":" + SUBSTRING([Time of Entry],5,2)

2.) Performing a data conversion task to convert [d_Time of Entry] from DT_STR(8) to time(0) The upload fails because values that start with a zero, i.e. times before 10am, have their leading 0's stripped before being derived.  You can see this because "011525" is derived as "11:52:5" when it should be "01:15:25".

View 10 Replies View Related

Date Formating - Military

Apr 13, 2007

Hello all,
I am trying to import an excel spreadsheet that has a specific date column. The column is saved as military time. For example, one of the records is:
 04-12-2007 09:30
 But, when i import the data into sql 2005, the above date is displayed as:
2007-04-12 09:30
 I need it to display like the same way that it's being displayed in the excel spreadsheet.
My field in sql is nvarchar(100) and it still doesn't work.
 
Any ideas?Thanks in advance.

View 3 Replies View Related

Formating The Output Of Mails

Nov 16, 2001

Hello,

I'm using xp_sendmail in the sp and in @query I do select * from table1.
The result also page,s
The formate is not at all readable and even if @attach_results = 'TRUE'
In the text file its not formatted as it sends mail to my manager I want it to be formatted and looks good. Can anyone help me or Is there any way to get the results in readable format.

Thanks in Advance for the help

Rani

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved