Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







Create Date Field From Substring Of Text Field


I am trying to populate a field in a SQL table based on the values
returned from using substring on a text field.

Example:

Field Name = RecNum
Field Value = 024071023

The 7th and 8th character of this number is the year. I am able to
get those digits by saying substring(recnum,7,2) and I get '02'. Now
what I need to do is determine if this is >= 50 then concatenate a
'19' to the front of it or if it is less that '50' concatenate a '20'.
This particular example should return '2002'. Then I want to take the
result of this and populate a field called TaxYear.

Any help would be greatly apprecaietd.

Mark


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Substring On Text Field
Hi,

According to the docs, when using substring on a text field (not varchar):


substring (<text>, start, length)


...the length in this case, represents BYTEs as opposed to number of characters. So my question is, how many bytes per character (or characters per byte)....or is this a possible conversion?

thanks,

View Replies !   View Related
Compare Date Field To Text Field
Hi,
 
I am very new to using SQL.  Our department usually uses Brio to query the various databases under our control.  However, I have recently come against a problem that prompted me to create a custom SQL query which works well as far as it goes.  My problem is looking for specific conditions in billing information I receive monthly.  I would like to compare on of the date fields contained in the database with a field in the form of YYYYMM (200710, for October 2007)  I have created a custom column generator that forms a date from the YYYYMM.  I would like, however, do the translation on the fly and make the comparison during the query.  The problem is that query without the date check returns a mass of data, only about 1 percent of which is what I want.
 
The beginning of the SQL query looks like this:
 
FROM From.T_Crs_Tran_Dtl WHERE T_Crs_Tran_Dtl.Crs_Bill_Yr_Mo IN ('200710', '200711', '200712') AND ((T_Crs_Tran_Dtl.Crs_Cde IN ('1G', '1V') AND (T_Crs_Tran_Dtl.Dptr_Dte < LastDay(ToDate(Substr ( Crs_Bill_Yr_Mo, 5, 2 )& "/1/"&Substr ( Crs_Bill_Yr_Mo, 1, 4 )))) AND (T_Crs_Tran_Dtl.Prev_Stats_Cde IN (' ', 'TK', 'TL') AND T_Crs_Tran_Dtl.Cur_Stats_Cde IN ('TK', 'TL') AND T_Crs_Tran_Dtl.Std_Tran_Typ_Cde='B') OR (T_Crs_Tran_Dtl.Prev_Stats_Cde='UN' AND T_Crs_Tran_Dtl.Cur_Stats_Cde='XX' AND€¦
 
It is the €œ(T_Crs_Tran_Dtl.Dptr_Dte < LastDay(ToDate(Substr ( Crs_Bill_Yr_Mo, 5, 2 )& "/1/"&Substr ( Crs_Bill_Yr_Mo, 1, 4 )))) AND€? part of the query that is just plain wrong.  The business part of this statement takes the YYYYMM field and turns it into a date which is the last day of YYYYMM.
 
I hope someone out there can help me with making this comparison.
 
I appreciate your help.
 
Bill
 

View Replies !   View Related
How To Add Date Field And Time Field (not Datetime Field )
Good morning...

I begin with SQL, I would like to add a field that will be date like 21/01/2000.

Actually i find just "datetime" format but give me the format 21/01/2000 01:01:20.

How to do for having date and time in two different field.

Sorry for my english....

Cordially 

A newbie

View Replies !   View Related
Create Rich Text From A Select And Save It In A Field
Hi,
I want to execute some queries inside a stored procedure, get the data and create from them some strings with formatted parts (bold, italic, underline, different color fonts) and save them in a text field. These strings are going to be displayed in some DBRichText control in a database application built with Delphi. Is there an easy way to create these complex rtf formats in MSSQL
or some ideas regarding this problem?

Best Regards,
Manolis Perrakis

View Replies !   View Related
Text Field To Display Date Parameter Chosen
Hi,

I'm attempting to use the following code to display either 'All' or the date value selected by the user from a Report parameter;

=iif(Parameters!FromCheckOutDateDate.Value.ToString = "[Check Out Date].[Date].[All]", "All", "From Date: " + Parameters!FromCheckOutDateDate.Value.ToString.Substring(26,10))

This is throwing an error ('#Error').

I can use the following code with no error, though its not as useful;

=iif(Parameters!FromCheckOutDateDate.Value.ToString = "[Check Out Date].[Date].[All]", "All", "Not all")

I can even use this to display the selected value (i.e. 2007-01-01);

Parameters!FromCheckOutDateDate.Value.ToString.Substring(26,10)

Why can't I use them both in my iif statement?

Can someone please help?

View Replies !   View Related
Pass In Null/blank Value In The Date Field Or Declare The Field As String And Convert
I need to pass in null/blank value in the date field or declare the field as string and convert date back to string.

I tried the 2nd option but I am having trouble converting the two digits of the recordset (rs_get_msp_info(2), 1, 2))) into a four digit yr. But it will only the yr in two digits.
The mfg_start_date is delcared as a string variable

mfg_start_date = CStr(CDate(Mid(rs_get_msp_info(2), 3, 2) & "/" & Mid(rs_get_msp_info(2), 5, 2) & "/" & Mid(rs_get_msp_info(2), 1, 2)))

option 1
I will have to declare the mfg_start_date as date but I need to send in a blank value for this variable in the stored procedure. It won't accept a null or blank value.

With refresh_shipping_sched
.ActiveConnection = CurrentProject.Connection
.CommandText = "spRefresh_shipping_sched"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("ret_val", adInteger, adParamReturnValue)
.Parameters.Append .CreateParameter("@option", adInteger, adParamInput, 4, update_option)
.Parameters.Append .CreateParameter("@mfg_ord_num", adChar, adParamInput, mfg_ord_num_length, "")
.Parameters.Append .CreateParameter("@mfg_start_date", adChar, adParamInput, 10, "")
Set rs_refresh_shipping_sched = .Execute
End

Please help

View Replies !   View Related
Informix Date Type Field To SQL Server Datetime Field Error
 

I am trying to drag data from Informix to Sql Server.  When I kick off the package
using an OLE DB Source and a SQL Server Destination,  I get DT_DBDATE to DT_DBTIMESTAMP
errors on two fields from Informix which are date data ....no timestamp part
 
I tried a couple of things:
 
Created a view of the Informix table where I cast the date fields as datetime year to fraction(5), which failed.
 
Altered the view to convert the date fields to char(10) with the hopes that SQL Server would implicitly cast them
as datetime but it failed.
 
What options do I have that will work?

View Replies !   View Related
Access Memo Field To SQL Server Text Field
Hi,

I'm importing an Access database to SQL Server 2000.
The issue I ran into is pretty frustrating... All Memo fields that get copied over (as Text fields) appear to be fine and visible in SQL Server Enterprise Manager... except when I display them on the web via ASP - everything is blank (no content at all).

I didn't have that problem with Access, so I ruled out the possibility that there's something wrong with the original data.

Is this some sort of an encoding problem that arose during database import?
I would appreciate any pointers.

View Replies !   View Related
Export Access Memo Field To SQL Text Field
Hi,

Can anyone point me any solution how to export a MEMO field from an Access database to a TEXT field from an MS SQL Server 2000. The import export tool from SQL server doesn't import these fields if they are very large - around 9000 characters.

Thanks.

View Replies !   View Related
MS Access Memo Field To SQL Server Text Field
Hi all,



i've a reasonable amount of experience with MS Access and less
experience with SQL Server. I've just written an .NET application that
uses an SQL Server database. I need to collate lots of data from around
the company in the simplest way, that can then be loaded into the SQL
Server database.



I decided to collect the info in Excel because that's what most people
know best and is the quickest to use. The idea being i could just copy
and paste the records directly into the SQL Server database table (in
the same format)  using the SQL Server Management Studio, for
example.



Trouble is, i have a problem with line feed characters. If an Excel
cell contains a chunk of text with line breaks (Chr(10) or Chr(13))
then the copy'n'paste doesn't work - only the text up to the first line
break is pasted into the SQL Server database cell. The rest is not
pasted for some reason.



I've tried with MS Access too, copying and pasting the contents of a
memo field into SQL Server database, but with exactly the same problem.
I've tried with 'text' or 'varchar' SQL Server database field formats.



Since i've no experience of using different types of databases
interacting together, can someone suggest the simplest way of
transferring the data without getting this problem with the line feeds?
I don't want to spend hours writing scripts/programs when it's just
this linefeed problem that is preventing the whole lot just being
cut'n'pasted in 5 seconds!



cheers

Dominic

View Replies !   View Related
Convert Var Char Field To Date Field
Hi,

I need to convert a var char field to date field (DD/MM/YYYY)

Current convertion format:
CAST(Report_Date as DATETIME)

How can i convert to Date field with date format of DD/MM/YYYY?

Thanks.

Onn Onn

View Replies !   View Related
SQL Substring On DateTime Field
Hi!
Can anyone tell me how to perform a substring operation on a DateTime field. I'm using SQLServer. I have read that you may have to use casts but I have thus far been unable to get that to work.
My statement:
SELECT EventDate FROM tblEvent WHERE Category = 'GE';
I just want to cut the hours, minutes and seconds off, so that I am left with just the date element.
Thanks all.
Gren

View Replies !   View Related
Substring'ing A Number-field
Hi :) and thanx for reading my post.I have to create a view based on a character in a number-field (fnr)which is 11 char's long. I have to get character nr "7".The problem is that i cannot use :--> SELECT fnr FROM table WHERE substring(fnr,7,1)since it's not a string.Any other way i can solve this ? Would be greatly and insanely happy ifanyone could help me out with a sample code or something.!Best regardsMirador*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View Replies !   View Related
Extracting Substring Into New Field
I am trying to populate two fields in my table with the first 6 characters in an existing field with the following command:

SELECT dimension_elist,
SUBSTRING(dimension_elist FROM 1 FOR 6)
AS BU_Number
SUBSTRING(dimension_jde_pl FROM 1 FOR 6)
AS Acct_Number
FROM JDE_Import

The result is an error:
Server: Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'FROM'.

I am fairly new to SQL so I am probably missing something basic.

Does anyone have any thoughts?

View Replies !   View Related
Should I Use Text Field Or Binary Field ?
Application is ocr'ing tiff image files and then storing the resultant text data in a text field in SQL 2005 database. This field is then used with the full text catalog.

All works fine,

However, am I using the correct field type to store the text files for efficiency and space saving?

If I use a binary field, does this reduce the size of the database by compressing the text data in the binary field? Also, is there a limit as to the size of text file that I could store in a binary field?

It would be good to get feedback on this before I go too far down the wrong road.

So, text field to store the text data or binary field to store the actual text file?

View Replies !   View Related
SUM If Date Field &&>=inputted Field?
I need help.  I'm one step short of getting what I need.
Here is what I have:
SELECT        FilteredIncident.accountidname, FilteredIncident.ticketnumber, FilteredIncident.createdon, FilteredIncident.modifiedon, FilteredIncident.new_enduserfirstname,
                          FilteredIncident.new_enduserlastname, FilteredIncident.responsiblecontactidname, FilteredIncident.statuscodename, FilteredIncident.title,
                     SUM(FilteredActivityPointer.actualdurationminutes) AS TotalTime
FROM            FilteredActivityPointer LEFT OUTER JOIN
                         FilteredIncident ON FilteredIncident.incidentid = FilteredActivityPointer.regardingobjectid
GROUP BY FilteredIncident.accountidname, FilteredIncident.ticketnumber, FilteredIncident.createdon, FilteredIncident.modifiedon, FilteredIncident.new_enduserfirstname,
                          FilteredIncident.new_enduserlastname, FilteredIncident.responsiblecontactidname, FilteredIncident.statuscodename, FilteredIncident.title
HAVING        (FilteredIncident.accountidname = @accountid) AND ((FilteredActivityPointer.actualstart >= @billtime) OR (FilteredIncident.statuscodename <> N'Problem Solved'))
 
This pulls everything that started after a certain date (@billtime) AND everything that is not closed.  This is what I want; however, I need the                     SUM(FilteredActivityPointer.actualdurationminutes) AS TotalTime to only calculate the TotalTime after the @billtime regardless of the status.  I can easily code in the date in the format 03/04/2008 but I haven't figured out how to do it successfully.  I tried an IIF within the SUM and just got a syntax error (I'm assuming it is because FilteredActivityPointer.actualstart is a date/time.)
 
Essentially, I need a report that shows all open tickets in the system AND all tickets that have been worked on since a specific date regardless of status that only totals the time spent during that date range.
 Many thanks to anyone who can help.

View Replies !   View Related
Insert/update/delete Large Volume Of Text For Text Field
How to write code in C for large volume of text insert/update/delete (text field)?
Any sample code using ODBC to achieve this?
Thank.

View Replies !   View Related
Problem With Text Field: Text Input Too Long, Weird Characters
Hi,

Im a programmer for an university webportal which uses php and msssql.
When an user creates a new entry and his text is too long the entry is cut short and weird characters appear at the end of the entry.

For example:
http://www.ttz.uni-magdeburg.de/scripts/test-messedb/php/index.php?option=show_presse&funktion=presse_show_mitteilung&id=333

How can I set the text limit to unlimited?
Could it be something else?
Is there a way of splitting an entry to several text fields automatically?


Thanks in advance for any help you can give me,
Chris

View Replies !   View Related
How Do I Convert A Unix Date/Time Field To A Date When The The SQL DB Stores That Data As Char 11?
Hi there. 
I'm trying to extract data from my SQL server & everything in the script I've got is working (extracting correct data) except for one field - which is for the most part it's off by +2 days (on a few occasions - I see it off by just +1 day or even +3, but it's usually the +2 days). 

I'm told that it's due to the conversion formula - but - since SQL is not my native language, I'm at a bit of a loss.

The DB table has the date field stored as a type: CHAR (as opposed to 'DATE')
Can anyone out there help?

Please advise.  Thanks.

Best.
K7

View Replies !   View Related
How Can I Parse Text Held In MS SQL 2005 Text Field
Hi,I been reading various web pages trying to figure out how I can extract some simple information from the XML below, but at present I cannot understand it.
I have a MS SQL 2005 database with which contains a field of type text (external database so field type cannot be changed to XML)The text field in the database is similar to the one below but I have simplified it by remove many of the unneeded tags in the <before> and <after> blocks. I also reformatted it to show the structure (original had no spaces or returns)
For each text field in the SQL table contain the XML I need to know the OldVal and the NewVal.
<ProductMergeAudit> <before>  <table name="table1" description="Test Desc">   <product id="OldVal">  </table> </before> <after>  <table name="table1" description="Test Desc">   <product id="NewVal">  </table> </after></ProductMergeAudit>

View Replies !   View Related
SQL Query Filtering Date Field By Today's Date?
Can someone tell me sql query for filtering date field for current day,not last 24hours but from 00:00 to current time?

View Replies !   View Related
Problem With Current Date For Date & Time Field
I have a table named "shift" and I need to setup my query to return only data where the field "startime" = today. The problem I am running into is the starttime field it laid out like "2005-12-29 14:00:00" with different time values. I need to ruturn everything that has todays date regardless of the time value. I tried using GetDate() but that is returning data for other days as well or just data before or after the current time. Does anyone have any suggestions? This is driving me crazy! Thanks, Garrett

View Replies !   View Related
Insert Date Into Column Based On Date Field
 

Hi,
 
I need to insert into a column (lets say column x) a date based on the date on another column (lets say column y).
 
What I need is:
 


Take the day and month from column x (all records are formated yyyy-mm-dd)

Place it in column y

The yyyy in column y should be - currenct year +1 and no the year in column x.
All help welcome.
 

View Replies !   View Related
(Urgent) How Get A Text Field And Put The Result Into A Text Var
Hi All

Iam trying to Get a text field value i wrote this code

DECLARE @ptrval varbinary(16)
DECLARE @length bigint
SELECT @ptrval = TEXTPTR(Template), @length = LEN(Template)
FROM #TEMPLATE
READTEXT Template.#TEMPLATE @ptrval 0 @length

but i need to put the result into a text var
is that possible or not and if it possible any one could help me with that

View Replies !   View Related
Inserting Formatted Text Into A Text Field
1) Is there any way to upload a file of text format to a column of a table. Copying and pasting of text works but I lose the formatting.
2) Is there any way to copy a file from the hard drive directly to the column of a table.

Dee.

View Replies !   View Related
Adding Text To A TEXT Field (MS-SQL2000)
Hi everyone,

I'm extremely new to SQL so be nice

I am attempting to write a script to add onto the end of a text field the words " -- Disposed " (About 60 rows worth).
The field is a TEXT field, so unlike a varchar field I can't just use Update as shown below.


Code:

Update AR_Primary_asset
Set AR_Primary_asset.description = AR_Primary_asset.description + ' -- Disposed'
Where AR_Primary_Asset.ASSET_REF in ('1','2','4')



I found on the Mircosoft pages about UPDATETEXT, but this only seem to work to update one row (In the case below Asset_ref = 3, was the only row effected) .


Code:

DECLARE @Dispose binary(16)
SELECT @Dispose = TEXTPTR(DESCRIPTION)
FROM AR_PRIMARY_ASSET
WHERE AR_Primary_Asset.ASSET_REF in ('1','2','3')

UPDATETEXT AR_PRIMARY_ASSET.DESCRIPTION @ptrval null null ' -- Disposed'



So i wrapped it into a cursor, this worked on my test SQL server which runs SQL2005.


Code:

DECLARE @Dispose varbinary(16)

DECLARE cursor1 CURSOR FOR
SELECT TEXTPTR(DESCRIPTION)
FROM AR_Primary_Asset
Where AR_Primary_Asset.ASSET_REF in('1','2','3')

OPEN cursor1

FETCH NEXT FROM cursor1
INTO @Dispose

WHILE @@FETCH_STATUS = 0
BEGIN

UPDATETEXT AR_Primary_Asset.DESCRIPTION @Dispose NULL NULL ' -- Disposed'

FETCH NEXT FROM cursor1
INTO @Dispose
END

CLOSE cursor1
DEALLOCATE cursor1



But when it was run on our SQL2000 server it gave the following error message

Quote: Msg 403, Level 16, State 1, Line 1

Invalid operator for data type. Operator equals add, type equals text.

I've never used vars, cursors, updatetext or even text fields before. So maybe I am going about it totally the wrong way.

Is anyone able to tell me a better way to write this? or how to make it compatible to SQL2000?

View Replies !   View Related
Comparing Today's Date With Date In Field
I want to be able to compare today's date with the date that is in the database. Right now I have:

Select Field1, Field2
FROM table 1
Where Year(TS_Date)=Year('3/1/2006')and Month(TS_Date)=Month('3/1/2006')

Where I have to change the date every month. Is there a way to use GetDate or another type of code so it could automatically update every month.
Any suggestions would be very greatful.

View Replies !   View Related
How To Create A RTF Field ?
How can I save the text of a rich text box in a sql express 2005 datatable ?

Of course I'd like to save the string and the format of the text (bold, color etc...).

Which column type I have to use for this RTF field ?

Thank you.

View Replies !   View Related
Create Linefeed In Field
Hello,I would like to create more lines by concatenating values.When I use: <select 'This' + ' ' + 'is' + ' ' + 'an' + ' ' +'example'> the result is <This is an example> (on the same line).I woul like to get:<Thisisanexample> (each 'word' on a new line, but in 1 field)Whis SQL statement do i have to use?

View Replies !   View Related
Any Need To Create An Index For A PK Field?
Are Primary Key fields automatically indexed, or do you have to create a seperate index for a PK in order for it to be indexed? I'm using SQL Server 2005.

View Replies !   View Related
How To Create An Aggregated Field
I have the following fields in table A:

GL_ID|GL_Name_VC | Amount |Period_TI|Year_SI
===================================================
1000| Inventory| 8,000.00 | 01 | 2005
===================================================
1000| Inventory| -3,000.00 | 02 | 2005
===================================================
1000| Inventory| 5,000.00 | 02 | 2005
===================================================


the fields above have the following datatype:

Fields | Datatype
===================================
GL_ID | Integer
GL_Name_VC | Variable Character
Amount | Integer
Period_TI | TinyInteger
Year_SI | SmallInteger

The above database is running on Microsoft SQL Server 2000 and i would like to query
for a report that looks something as below:

GL_ID | GL_Name_VC |Op Bal|Period_Dr|Period_Cr|Period Bal|Closing Bal
======================================================================
1000 | Inventory |8,000 | 5,000 | -3,000 | 2,000 |10,000

The above report has an Op Bal column which is the sum of all amount in Period 01 in
Year 2005 carried forward as opening balance in Period 02, Period_Dr Column would contain
all positive amount in Period 02 & Period_Cr Column would contain all negative amount
in Period 02. Period Bal is the summation of both Period_Dr & Period_Cr and Closing Bal
column is the summation of Op Bal + Period Bal.

Guys, hope someone out there can help me with the sql command for the above report?

View Replies !   View Related
Create Unique Field That Isn't The Key
I have a table where the key is an autonumber. I also have a field which holds the reference of a room eg 0BM1. It is nvarchar. Is there a way I can set this field to duplicates = No, so that my user cannot enter the same room reference more than once. Or do I have to do this check in my asp.net code ?

TIA

View Replies !   View Related
How To Dynamic Create Bit Field On Sql
 

Hi
 
In Sqlserve we can create dynmic field on sql like:
 
Select '' as Name from Employee.
 
It creates a string field.
 
I want to how to create a Bit field in this way.
 
Regards
Deepak

View Replies !   View Related
Date Field
I have a database table that contains a date field.

I don't know how to construct an sql query that returns the record that has the next closest date (in the future) to the actual date.

I know I need to brush up on sql but any help would be greatly appreciated.

Thanks

Ramila

View Replies !   View Related
Date Field
I have a date field that I imported as a varchar (as there were Null values) - anyway, the dates are in European format as well as in American format

12/24/00

24/12/00

Is there a query I can run to make all the entries in the field be listeed in US Format?

Also, I suspect that the Server is reading 00 as 1900 - not sure but a

'Select * from employee where TstartDate > 01/02/00'

returns all values ie 02/12/97 and all the rest.

Can anyone help?

Thanks in advance,

Anthony

View Replies !   View Related
MS SQL - Date Field?
I have set my record rsAge to a datetime and set default value to (getdate()) I want to fill in a date of birth, when i try this with something like 08/11/78 it just comes back with: 01/01/1900 00:00:00

View Replies !   View Related
Date Field Using T-sql
hi friends

               i wish to set a date data type to a column "Date". when i use datetime format, the values is inserted in the U.S. date & time format. i want  the values to be in the british english format. i.e dd/mm/yyyy only and does not require time value. can any one help me to insert the date values in the british english format


regards..,

sekar.

View Replies !   View Related
Date Field
Ho do you set the date field in an SQL SERVER table.



I only want to show just the date without time in my col.


Isnt there a DATE type for SQL table.
I have a big problem with dates as I have imported all
my datas from Access MDB.


Tnx

View Replies !   View Related
Long Text Field
 Hi

I
have a textbox field that take 2000 characters from user..Then I used a store
procedure to save that user input into database through an insert statement, but
for some reason it just never store the whole string of 2000 characters but only
store some of it (like 100 or something) .. Seems like a data type problem…(I  am using SQL server 2000)

 

This
is what I have defined:

 

---------------------------------------

In
storeprocedure:

 

@iidea2
varchar(2000)



 

View Replies !   View Related
Searching Text In A Db Field
Im building up a query in my code behind. When I execute this query it returns a list of users who match the criteria.BUT, I want to add something extra. In my DB in the tblUserData there's a field "interests" datatype nvarchar(30) which contains the numbers (comma-delimited) of the interestsID in my tblInterests. For example, my interestsfield may contain something like: 1,4,8Now if someone wants to find someone who has number 4 and 8 as interests, how can I search in this textfield?!?I wrote this in a SP, but I'd really like it to be possible from code-behind and build the query myself...declare @s varchar(20)set @s='4,8'EXEC('SELECT * FROM tblUserData WHERE Interests in ('+@s+')')

View Replies !   View Related
Cant Sort A Text Field!
Hiive got a table and contains a surname text field.  Why cant i do a select statement ORDER BY surname.  I get an error saying i cant sort a text field!  how do i go around it!thanks

View Replies !   View Related
Problem With Text Field
Hi,

I am haveing a field called as description in a table called info in the database. Now when I give the following query:

select * from info where description = 'test'

it gives me error:

Microsoft OLE DB Provider for SQL Server (0x80040E14)
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

How can I do the above.

Thanks in advance,
Uday.

View Replies !   View Related
SQL Server Text Field
Is there a length limit on retrieving Microsoft SQL Server text fields?ThanksSiobhan*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!

View Replies !   View Related
Text Field Compare
I am a bit of a SQL Server newbie and have a question. I'm trying to compare two text fields. Both are 56 character fields and are a company name (one company want to see how much customer overlap they have with a newly acquired company). As you can imagine the names are a bit different in each ABN AMRO versus ABN AMRO INC. I tried comparing the first 6, 7, 8 characters with some success. Is there a more advanced way to do this? I appreciate the help.

View Replies !   View Related
Text Field Copying
I am working with a homecare application that stores nursing notes into a text field in the database. The database is growing exponentially and I want to create a procedure that select all notes older than six months, write it to an OS file, then deletes the record in the database. I am doing the writing using a cursor, however this is very slow.

Has anyone done anything similar? Let me know..

Thanks

View Replies !   View Related
Is It Possible To Get The Max Length Of A TEXT Field?
I have a text field and want to know if any of the text exceeds 10,000 characters

I can do a select max(len(rtrim(convert(varchar(8000)))) on the field but I'm not able to do for more than 8000 and you can't manipulate TEXT datay type.

Any ideas?
Thanks!

View Replies !   View Related
Replication - TEXT Field
I have a table that has a TEXT field and I want to replicate it. It already has a primary key field in it. I read that in SQL Server 6.5, you can do transactional replication on a table that has a TEXT field in it. I'm wondering if I need to do any other special configuration to replicate this table, i.e. enable the truncate on checkpoint option or anything else? Thanks, Hoang

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved