How Do I Strip The Time Portion From The Getdate() Value?

Sep 1, 2006

the ssis expression language getdate() function returns the current date with the current time. i only need to get the current date, without the current time. for example: 9/1/2006

how would i construct the proper expression to return this value?

thanks in advance.

View 2 Replies


ADVERTISEMENT

How Can I Strip Off The Time Portion Without Changing The Datatype

Oct 16, 2007

Is there a way to strip off the time portion of a datetime datatype without changing the datatype?
I know I can convert it using CONVERT (NVARCHAR(10), dbo.tblPayments.PaymentDate, 101) but I need to keep it as a datetime datatype?

View 5 Replies View Related

Transact SQL :: Update Time Portion Of DateTime Field With Time Parameter

Oct 3, 2015

I hope to update a DateTime column value with a Time input parameter.  Poor attempt below but it looks like the @ApptTime param is coming in as 10:45:00.0000000 and I might have an existing @SendOnDate as: 2015-10-05 07:00:00.000...I hope to end up with 2015-10-05 10:45:00.000

ALTER PROCEDURE [dbo].[SendEditUPDATE]
@QuePoolID int=null
,@ApptTime time(7)
,@SendOnDate datetime

[code]...

View 14 Replies View Related

Strip Time Out Of A Date Field - Sql

Dec 3, 2004

Hi all,

I have a table that I've imported into SQL - there is a field in there for date that must have used now(); as its default value (access).

So the values are something like:

01/11/2004 12:16:42

I need a way to change the data so that the time element removed is the field just holds the date. Failing that a way to insert this from the existing field into a new field stripping the date off en route would be a great help.

Many thanks

Phil

View 2 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

Updating Only Time Portion Of Datetime?

Oct 26, 2015

I want to update only time portion of a datetime column as 00:00:00:000

Values are like:

2006-08-28 17:10:10.607
2007-02-10 11:24:12.090
2007-02-10 11:24:14.967

I want to do them like:

2006-08-28 16:10:10.607
2007-02-10 10:24:12.090
2007-02-10 10:24:14.967

update [ALLBD].[dbo].[Terminal]
set [Hour]= '1900-01-01 09:49:00.000'
where ...

View 5 Replies View Related

Problem With Getdate() In Transaction Takes The Insert Time Instead Of The Commit Time

Nov 12, 2007

Hi,

We need to select rows from the database that have been recently inserted/updated. We have a main primary table (COMMIT_TEST) and a second update table (COMMIT_TEST_UPDATE). The update table contains the primary key and a LAST_UPDATE field which is a datetime (to tell us when an update occurred). Triggers on the primary table are used to populate the update table.

If we insert or update the primary table in a transaction, we would expect that the datetime of the insert/update would be at the commit, however it seems that the insert/update statement is cached and getdate() is executed at the time of the cache instead of the commit. This causes problems as we select rows based on LAST_UPDATE and a commit may occur later but the earlier insert timestamp is saved to the database and we miss that update.

We would like to know if there is anyway to tell the SQL Server to not execute the function getdate() until the commit, or any other way to get the commit to create the correct timestamp.

We are using default isolation level. We have tried using getdate(), current_timestamp and even {fn Now()} with the same results. SQL Queries that reproduce the problem are provided below:


/* Different functions to get current timestamp €“ all have been tested to produce the same results */
/*
SELECT GETDATE()
GO
SELECT CURRENT_TIMESTAMP
GO
SELECT {fn Now()}
GO
*/
/* Use these statements to delete the tables to allow recreate of the tables */
/*
DROP TABLE COMMIT_TEST
DROP TABLE COMMIT_TEST_UPDATE
*/
/* Create a primary table and an UPDATE table to store the date/time when the primary table is modified */
CREATE TABLE dbo.COMMIT_TEST (PKEY int PRIMARY KEY, timestamp) /* ROW_VERSION rowversion */
GO
CREATE TABLE dbo.COMMIT_TEST_UPDATE (PKEY int PRIMARY KEY, LAST_UPDATE datetime, timestamp ) /* ROW_VERSION rowversion */
GO
/* Use these statements to delete the triggers to allow reinsert */
/*
drop trigger LOG_COMMIT_TEST_INSERT
drop trigger LOG_COMMIT_TEST_UPDATE
drop trigger LOG_COMMIT_TEST_DELETE
*/
/* Create insert, update and delete triggers */
create trigger LOG_COMMIT_TEST_INSERT on COMMIT_TEST for INSERT as
begin
declare @time datetime
select @time = getdate()

insert into COMMIT_TEST_UPDATE (PKEY,LAST_UPDATE)
select PKEY, getdate()
from inserted
end
GO
create trigger LOG_COMMIT_TEST_UPDATE on COMMIT_TEST for UPDATE as
begin
declare @time datetime
select @time = getdate()

update COMMIT_TEST_UPDATE
set LAST_UPDATE = getdate()
from COMMIT_TEST_UPDATE, deleted, inserted
where COMMIT_TEST_UPDATE.PKEY = deleted.PKEY
end
GO
/* In our application deletes should never occur so we don€™t log when they get modified we just delete them from the UPDATE table */
create trigger LOG_COMMIT_TEST_DELETE on COMMIT_TEST for DELETE as
begin
if ( select count(*) from deleted ) > 0
begin
delete COMMIT_TEST_UPDATE
from COMMIT_TEST_UPDATE, deleted
where COMMIT_TEST_UPDATE.PKEY = deleted.PKEY
end
end
GO
/* Delete any previous inserted record to avoid errors when inserting */
DELETE COMMIT_TEST WHERE PKEY = 1
GO
/* What is the current date/time */
SELECT GETDATE()
GO
BEGIN TRANSACTION
GO
/* Insert a record into the primary table */
INSERT COMMIT_TEST (PKEY) VALUES (1)
GO
/* Simulate additional processing within this transaction */
WAITFOR DELAY '00:00:10'
GO
/* We expect at this point that the date is written to the database (or at least we need some way for this to happen) */
COMMIT TRANSACTION
GO
/* get the current date to show us what date/time should have been committed to the database */
SELECT GETDATE()
GO
/* Select results from the table €“ we see that the timestamp is 10 seconds older than the commit, in other words it was evaluated at */
/* the insert statement, even though the row could not be read with a SELECT as it was uncommitted */
SELECT * FROM COMMIT_TEST
GO
SELECT * FROM COMMIT_TEST_UPDATE


Any help would be appreciated, we understand we could make changes to the application/database to approximate what we need, but all the solutions have identified suffer from possible performance issues, or could still lead to missing deals (assuming the commit time is larger than some artifical time window).

Regards,

Mark

View 8 Replies View Related

Truncate The Time Portion In Datetime Stamp

Apr 1, 2003

Hi all:
first of all, i must say that this website is just awesome...

my question is how do i truncate the time portion in a datetime stamp in a single sql statement.

thanks.

View 9 Replies View Related

Ignore Time Portion Of Datetime Field

Feb 16, 2004

I have a PHP page where the user enters a date that represents the last day of a timesheet (ts_end) and the hours worked on that timesheet. That is then written into a table where the date is a datetime type. Because the user just enters a date, the time portion of the field is set to 00:00:00. In another place, I need to sum the columns for reports submitted between the beginning of a timesheet (ts_end -6 days) and the ts_end date.

The problem is that chartreviewed values entered on the ts_end date are getting lost because the time part of the ts_end field is 00:00:00 and the time part of the dateentered for the chartreviewed value is not. For instance using 2/4/2004 as the ts_end date looses the 192 charts.

Reporter activity chartsdateentered
2001576 20672 563 2004-01-29 13:55:51.000
2001576 20665 202 2004-02-02 19:54:57.000
2001576 20666 160 2004-02-03 22:48:11.000
2001576 20667 192 2004-02-04 19:41:51.000

I know I can revise the query to look for charts where the dateentered is less than dateadd(d,1,ts_end) and get the right values. It seems like there has to be a way though to tell sqlserver to ignore the time part of a datetime field when querying.

Anybody know what it is?

Thanks,
Ursus

View 4 Replies View Related

Drop The Time Portion Of A Smalldatetime Field

Jul 20, 2005

In VBA I'd use Format(myDateField,"Short Date") to display 1/31/2004instead of 1/31/2004 10:30:25 AMHow can I do this in a stored procedure?lq

View 2 Replies View Related

Update Time Portion Of The Datetime Field In Sql

Sep 24, 2007

I have a datetime field named 'EntryDate' in one of the sql tables.

I want to update the time portion of this field and provide a default time of 8:00 AM IF the time portion is empty.

How can i do this?

View 6 Replies View Related

Update Time Portion Of The Datetime Field In Sql Table

Apr 21, 2008

I have startdate and enddate. I like startdate to be 4/28/08 12:00:00 and enddate to be 5/4/08 23:59:59. What update statement do i need to run to update table. Currently my table show startdate 2008-04-28 05:00:00.000
enddate 2008-05-04 04:59:59.000.

View 4 Replies View Related

Transact SQL :: How To Get Time Portion Only Of A Date For LINQ Query

Aug 4, 2015

I'm trying to translate this portion of VFP code into LINQ query:

select COUNT(ID) as conflicts
from dbo.max4sale where <<thisform.cWhere>>
AND Start_Time >= <<VFP2SQL(m.ltBegin + m.lnStartTime)>>
and Start_time <= <<VFP2SQL(m.ltEnd)>>
AND CONVERT(varchar(5),Start_Time,108) <= <<VFP2SQL(m.lcEndTime)>>
AND CONVERT(varchar(5),End_Time,108) >= <<VFP2SQL(m.lcStartTime)>>
<<m.lcDays>>

Here is my non-working attempt:

var startTime = new DateTime(1900, 1, 1, beginDateTime.Hour, beginDateTime.Minute, 0);
var endTime = new DateTime(1900, 1, 1, endDateTime.Hour, endDateTime.Minute, 0);
var daysOfWeek = dailyLimits.Where(dl => dl.Selected == true).Select(ds => ds.WeekDay).ToList();
if (daysOfWeek.Count() < 7) // not all days of the week selected

[Code] .......

First of all, I see a bug in my logic now as the first part of the query I need to do all the time and only the second part if the count < 7. But that's not my problem - I can not figure out how to make times comparison only using LINQ. Ideally I think I'd like to have cast(start_time as time) >= @p1 as a result to be executed by LINQ.

BTW, I am only getting the error in run-time that Parse can not be interpreted. So, I need to figure out another way of making LINQ recognize my intent of checking time portion of the date only.

View 9 Replies View Related

Update Time Portion Of The Datetime Field In Sql Table

Apr 21, 2008

I like to add a day to this date and also make time to 23:59:59. So end result for this table and recrods will be 2008-11-09 23:59:59 and next row 2008-11-16 23:59:59 so on.....
2008-11-08 23:00:00.000
2008-11-15 23:00:00.000
2008-11-22 23:00:00.000
2008-11-29 23:00:00.000
2008-12-06 23:00:00.000
2008-12-13 23:00:00.000
2008-12-20 23:00:00.000
2008-12-27 23:00:00.000
2009-01-03 23:00:00.000
2009-01-10 23:00:00.000
2009-01-17 23:00:00.000
2009-01-24 23:00:00.000
2009-01-31 23:00:00.000
2009-02-07 23:00:00.000
2009-02-14 23:00:00.000
2009-02-21 23:00:00.000
2009-02-28 23:00:00.000
2009-03-07 23:00:00.000

View 3 Replies View Related

Update Time Portion Of The Datetime Field In Sql Table

Apr 21, 2008

I have two table I like to change startdate time to 00:00:00.00 and Enddate time to 23:59:59.000

Table 1
ID Startdate Enddate

418 2008-04-28 05:00:00.000 2008-05-04 05:00:00.000
419 2008-05-05 05:00:00.000 2008-05-11 05:00:00.000
420 2008-05-12 05:00:00.000 2008-05-18 05:00:00.000
421 2008-05-19 05:00:00.000 2008-05-25 05:00:00.000
422 2008-05-26 05:00:00.000 2008-06-01 05:00:00.000
423 2008-06-02 05:00:00.000 2008-06-08 05:00:00.000
424 2008-06-09 05:00:00.000 2008-06-15 05:00:00.000
425 2008-06-16 05:00:00.000 2008-06-22 05:00:00.000
426 2008-06-23 05:00:00.000 2008-06-29 05:00:00.000
427 2008-06-30 05:00:00.000 2008-07-06 05:00:00.000
428 2008-07-07 05:00:00.000 2008-07-13 05:00:00.000
429 2008-07-14 05:00:00.000 2008-07-20 05:00:00.000
430 2008-07-21 05:00:00.000 2008-07-27 05:00:00.000
431 2008-07-28 05:00:00.000 2008-08-03 05:00:00.000
432 2008-08-04 05:00:00.000 2008-08-10 05:00:00.000
433 2008-08-11 05:00:00.000 2008-08-17 05:00:00.000
434 2008-08-18 05:00:00.000 2008-08-24 05:00:00.000
435 2008-08-25 05:00:00.000 2008-08-31 05:00:00.000

Table 2
ID Startdate Enddate
445 2008-11-03 06:00:00.000 2008-11-09 06:00:00.000
446 2008-11-10 06:00:00.000 2008-11-16 06:00:00.000
447 2008-11-17 06:00:00.000 2008-11-23 06:00:00.000
448 2008-11-24 06:00:00.000 2008-11-30 06:00:00.000
449 2008-12-01 06:00:00.000 2008-12-07 06:00:00.000
450 2008-12-08 06:00:00.000 2008-12-14 06:00:00.000
451 2008-12-15 06:00:00.000 2008-12-21 06:00:00.000
452 2008-12-22 06:00:00.000 2008-12-28 06:00:00.000
453 2008-12-29 06:00:00.000 2009-01-04 06:00:00.000
454 2009-01-05 06:00:00.000 2009-01-11 06:00:00.000
455 2009-01-12 06:00:00.000 2009-01-18 06:00:00.000
456 2009-01-19 06:00:00.000 2009-01-25 06:00:00.000
457 2009-01-26 06:00:00.000 2009-02-01 06:00:00.000
458 2009-02-02 06:00:00.000 2009-02-08 06:00:00.000
459 2009-02-09 06:00:00.000 2009-02-15 06:00:00.000
460 2009-02-16 06:00:00.000 2009-02-22 06:00:00.000
461 2009-02-23 06:00:00.000 2009-03-01 06:00:00.000
462 2009-03-02 06:00:00.000 2009-03-08 06:00:00.000

View 1 Replies View Related

Getdate() With No Time Associated

May 26, 2006

Is there a command that will let me set getdate() a in a smalldatetime field so that the there is no time associated with it?

For example, I have a table that I want to load the date a user does an action. If I use getdate() I'll get a value such as 5/25/2006 08:26:56.340, whereas I would just like a value 5/25/2006.

I can work it out by doing the following: select (datename(month,getdate())+'-'+datename(day,getdate())+'-'
+datename(year,getdate()))

However it seems to me that there should be a simpler way.

View 4 Replies View Related

Getdate() Problem: Where Is The Time Taken From ?

Apr 25, 2007

Hi,I have a funny situation.Within: MSSQL 2000 SP3, everything below described is running on samePC.there is a program running, which sends information to two otherprograms.This information is a timestamp of the program in datetime format,which has it's own clock.The clock is incremented each 5 seconds of the program, whichcorespondes to aprox. one second of the real time.It means, each on second of real time, the computer time is updated +5seconds.Now, two other applications, are getting this information at the samemoment.FIRST of this applications, updates local time of the computer withthe time recieved.SECOND application, writes a protocol to file, with timestamp read atmoment of writing from operating system.Until now, all times are equal (the differences are not biger thatms).Now, the SECOND application, after writing a log into file (withproper timestamp), calls SP in database.It passes as input prm. the time recieved from very first program,which is the same time as the current system time, which is the sametime the SECOND application writes to the log file.This SP (besides other things) at the very beginning writes a log intotable, where two times are logged:- getdate() to first column,- timestamp recieved as input parameter.Now the funny thing.I would expect, the times are equal.getdate() = '2007.04.25 10:00:00.000'prm_recieved = '2007.04.25 10:00:00.000'I would expect, that the time from getdate() will be shifted withmiliseconds (because of call etc).getdate() = '2007.04.25 10:00:00.123'prm_recieved = '2007.04.25 10:00:00.000'I would even expect, that the time is shifted 5 seconds ahead:getdate() = '2007.04.25 10:00:05.000'prm_recieved = '2007.04.25 10:00:00.000'or, 5 seconds and some miliseconds:getdate() = '2007.04.25 10:00:05.123'prm_recieved = '2007.04.25 10:00:00.000'What I can not UNDERSTAND, why sometimes the time is equal, orsometimes is ALMOST equal (within the diff of miliseconds), and whysometimes the time is like this(!!!) :getdate() = '2007.04.25 10:59:55.000'prm_recieved = '2007.04.25 10:00:00.000'It seams to me, the getdate is getting somehow the PERVIOUS localsystem time, which was acctualy already upgraded ! Becasue all otherapp's are having the proper value.All other apps are writen in C++ and are very simple.I was trying to set the SQLServer running property higher - with noresult.I need to mention, there is SQLServer Agent running, and one procedurewith endless loop, with waitfor delay equal 2 seconds.But non of them (changing the waitfor delay to other value, disablingSQLAgent) fixes the problem.Can somebody then tell me, where from is the time taken, or what isthe root problem of this issue?Or what can it be?Best regards,Matik

View 6 Replies View Related

Removing Time Part Of GetDate()

Nov 7, 2000

I've been using the GetDate() function to populate a column in a table.
But it populates it with both the date and time: 2000-11-08 11:22:28

I'd like it to just put in the date: 2000-11-08

I've tried the Convert function as well as other functions, to no avail.
Some attempts have reversed month and day (I'm in Australia, so all PCs and Servers are set with a dd-mm-yy date format)

Any suggestions please?

View 1 Replies View Related

MS SQL GetDate() Function Remove Time

Jul 4, 2007

Hi,I am creating creating a table with a Date column dd-mm-yyyy. But Icant seem to find a SQL function that just returns today's date.getDate() returns the time as well so I cant use it.The reason is simply that I want to update/overwrite over and overagain all records from current day but not touch the ones fromyesterday etc and with the timestamp in there I just end up addingmore and more rows for the same day.In other words I only want to preserve rows are from yesterday orolder but overwrite ones from today.Any help will be appricated.Thank you!Yas

View 3 Replies View Related

GETDATE() And The Local Time Zone

Mar 14, 2007

I have used the GETDATE() function within an expression to create a directory name based on the current date. I am in the Sydney time zone and the new day's folder name doesn't change until after 11 am - so GETDATE() is picking up the date and not adjusting for the time zone. How do I either set the time zone within the package or make the GETDATE() function look at time zone of the system on which it is run?

View 3 Replies View Related

SQL 2012 :: Getdate Pulls Time From Midnight To 23:59 Hours?

Jun 23, 2015

What is the proper way to ensure when pulling date between two getdates, that you include from midnight of the first getdate to 23:59 hours in the second getdate?

WD.WRKD_WORK_DATE
and WD.WRKD_WORK_DATE between DATEADD(DD, - 11, GETDATE())
and DATEADD(DD, - 5, GETDATE())

View 3 Replies View Related

Getdate() >= Startdate And Getdate() <= Enddate

Oct 4, 2000

Please i need an exmple of ur solution, thanks :)

I'm using some files to show certain pages on certain date for an example

File name : aa.doc
start date: 10/02/00
end date : 10/03/00

But it expires on 10/02/00, here is the strored procedure:

Before the date comes, it expires the page
Here is my stored procedure:

"
SELECT startdate, enddate,archivedate
and (startdate is null or (getdate() >= startdate and getdate() <= enddate))
and (archivedate is null or (getdate() <= archivedate))
group by startdate, enddate order by startdate desc "

Thankx a lot

View 1 Replies View Related

Strip Certain Characters

Jul 13, 2004

Can anyone tell me how I can strip certain chahrcters from a string

I know I can use replace, but i don't think this is appropriate for what I want to do

For example I have the string

declare @text varchar (100)
select @text = 'word1, word2 & word3'

if i do a replace on the string like this
select @text = 'replace(@text, ',', '')
select @text = 'replace(@text, '&', '')

I end up with the string
select @text = 'word1 word2 word3'

i.e. 2 spaces between word2 and word3

What i want the string to look like is :
select @text = 'word1 word2 word3'

Is there a way i can check for more than one space + characters ( / , &) in one go

many thanks

View 4 Replies View Related

How Do You Strip Off Stars

Feb 26, 2004

I don't know how the stars are attribuated
but I don't think I should have so many
It gives a false impression to new members

View 3 Replies View Related

Strip Those RTF Tags Away

Sep 26, 2007

This algorithm can be used to strip out HTML tags too.
With reference to http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=89973
and http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=90000CREATE FUNCTIONdbo.fnParseRTF
(
@rtf VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE@Stage TABLE
(
Chr CHAR(1),
Pos INT
)

INSERT@Stage
(
Chr,
Pos
)
SELECTSUBSTRING(@rtf, Number, 1),
Number
FROMmaster..spt_values
WHEREType = 'p'
AND SUBSTRING(@rtf, Number, 1) IN ('{', '}')

DECLARE@Pos1 INT,
@Pos2 INT

SELECT@Pos1 = MIN(Pos),
@Pos2 = MAX(Pos)
FROM@Stage

DELETE
FROM@Stage
WHEREPos IN (@Pos1, @Pos2)

WHILE 1 = 1
BEGIN
SELECT TOP 1@Pos1 = s1.Pos,
@Pos2 = s2.Pos
FROM@Stage AS s1
INNER JOIN@Stage AS s2 ON s2.Pos > s1.Pos
WHEREs1.Chr = '{'
AND s2.Chr = '}'
ORDER BYs2.Pos - s1.Pos

IF @@ROWCOUNT = 0
BREAK

DELETE
FROM@Stage
WHEREPos IN (@Pos1, @Pos2)

UPDATE@Stage
SETPos = Pos - @Pos2 + @Pos1 - 1
WHEREPos > @Pos2

SET @rtf = STUFF(@rtf, @Pos1, @Pos2 - @Pos1 + 1, '')
END

SET@Pos1 = PATINDEX('%cf[0123456789][0123456789 ]%', @rtf)

WHILE @Pos1 > 0
SELECT@Pos2 = CHARINDEX(' ', @rtf, @Pos1 + 1),
@rtf = STUFF(@rtf, @Pos1, @Pos2 - @Pos1 + 1, ''),
@Pos1 = PATINDEX('%cf[0123456789][0123456789 ]%', @rtf)

SELECT@rtf = REPLACE(@rtf, 'pard', ''),
@rtf = REPLACE(@rtf, 'par', ''),
@rtf = LEFT(@rtf, LEN(@rtf) - 1)

SELECT@rtf = REPLACE(@rtf, '0 ', ''),
@rtf = REPLACE(@rtf, ' ', '')

SELECT@rtf = STUFF(@rtf, 1, CHARINDEX(' ', @rtf), '')

RETURN@rtf
ENDE 12°55'05.25"
N 56°04'39.16"

View 10 Replies View Related

Select Convert(varchar(16), Getdate(), 101)+LEFT(REPLACE(convert(varchar, Getdate(), 108), ':', ''),4)

Sep 26, 2007



select convert(varchar(16), getdate(), 101)+LEFT(REPLACE(convert(varchar, getdate(), 108), ':', ''),4)

From above query I get

mmddyyyyhhmm

but it' s yyyy and hour can not be separated

04/12/200702:05

How can I separated the year and hour ?

Thanks
Daniel

View 2 Replies View Related

Strip String From Csv Column

Mar 26, 2004

I have a column of 5 comma-separated-value strings:

stringA, stringB, stringC, stringD, stringE

The strings are GUID's with the hyphen stripped and made all uppercase so they are completely random. I need to be able to remove any one of the strings including the comma, in a stored procedure and I am not sure how to accomplish this.

SELECT tickets
FROM users
WHERE CONTAINS (tickets, @ticket)

IF @@rowcount > 0
REMOVE STUFF HERE
SET @valid = 1
ELSE
SET @valid = 0

So if stringB gets passed in as @ticket then the new value in the column would be :

stringA, stringC, stringD, stringE

Any help is greatly appreciated.
Thank you
dave

View 9 Replies View Related

Strip Off Part Of A String

Dec 4, 2000

I am trying to strip off 'XYZ' from column1 in table1 whenever it occurs
Any help appreciated
saad

View 4 Replies View Related

Strip Text From A String

Feb 17, 2004

I'm trying to find a way to strip text from a string. In the past (pre SQL Server) I would've used

LName: Left(NCBH!Name,InStr(1,NCBH!NAME,",",1)-1)

To strip the last name from a string like

Franks,George J

Apparently InStr is not a recognized function in SQL Server 2000. Or is it available but not in a view?

Any thoughts would be greatly appreciated.

View 2 Replies View Related

Strip Characters Out Of String

Jan 11, 2002

I have a phone number string (416) 555-5555 in a table. I'd like to perform a search on the string so that the user is able to pass any number, and the query returns all phone numbers like it. What I'd like to do is to strip out the brackets and dashes and perform a like search.

View 4 Replies View Related

Export To PDF Strip Out Space

Dec 14, 2007

Hi,
I use RS 2005 SP2.
I add a text item value " smth..."
No problem in preview, but export to pdf strip out whitespace characters and then my report in pdf like:
"smth..."

Is there a solution

View 15 Replies View Related

Get Date Portion From Datetime

Jun 15, 2006

Hi all
How to get just the date portion from a datetime field from sql server?
thanks a lot

View 5 Replies View Related

[Match Any Portion] - Possible In MSSQL?

Oct 10, 2005

I asked this question in the mysql forums, but I am also interested in any info regarding MSSQL. I've seen databases with search systems with the functionality I seek below. I just have no idea how they are doing it. Thank you.

We have an mysql inventory database. We want to be able to put in 4984.600 and choose "match any portion" and it finds 4984600 which is in our database.

Does Mysql have a "match any portion" search function? In this case LIKE didn't work which we tried already.

Any ideas? or are we stuck with using MSSQL. We know this will work with MSSQL.

Thank you very much. This is a huge problem for us.

Jim

View 3 Replies View Related







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