Archived Months
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
all groups > sql server mseq > october 2005

NULL encountered in math
Posted by Joseph at 10/31/2005 3:50:03 PM
I need to subtract two values in a table. One of these values contains a NULL entry. Each time I use the (Pledge - Credit) as 'Difference' I get the value of NULL. How do I get T-SQL to replace the NULL with zero? I encountered this a long time ago while concatenating data. I was able t...more >>


Fixed length records
Posted by Stan at 10/31/2005 12:36:06 PM
I have to build a text file that has 80 character records. I have a number of fixed length fields in the file but need to add a 'filler' at the end of the fields to get to 80. Do I have to create a dummy variable to do that and if so, how? Thanks -- Stan Gosselin...more >>

sel query
Posted by shif at 10/30/2005 1:36:04 AM
HI i am having 2 tables pur_hd and pur_det, Pur_hd is having invoice_date and pur_det is having cost column, and common column purno is in both table for linking.How can i take the cost of max(invoice_date)from pur_det table using select stmt. thanks...more >>

displaying smallmoney to 2 decimal places
Posted by Kim at 10/28/2005 6:05:01 PM
Heres an example of a query with the display SELECT * FROM STOCKks WHERE Price < Cost; Both price and cost are smallmoney datatypes. They display with 4 digits to the left of decimal pt. How do I set it to display only 2 digits for both colums? THanks, Kim...more >>

right justify left zero fill
Posted by Stan at 10/28/2005 5:35:03 AM
I have to build a text file with a dollar amount that must be right justified, left zero filled and no decimal. The field I am extracting data from is 'amount' and defined as decimal 9(15,2). -- Stan Gosselin...more >>

Selecting by date
Posted by Stan at 10/27/2005 2:46:02 PM
I have a table that has the significant date set up as a CHAR datatype with length of 8, i.e 20051027. I want to select all transactions where this date equals the system date. -- Stan Gosselin...more >>

password
Posted by RonP at 10/26/2005 12:20:02 PM
I have lost my password for my mssqlserver can someone help me retrieve it or should I delete this server and download another....more >>

Compare Character to numberic
Posted by Daniell at 10/25/2005 4:11:01 PM
I have to join two table based on the matching of two fields. The bad part is one field is numeric but defined as Character and the other field is decmial. This is my SQL. FROM SLTEST1.STST1 STST1 LEFT OUTER JOIN SLTEST1.STST2 STST2 ON STST1.AUTH1 = STST2.AUTH2 AND STST1.SLIP1...more >>



Views
Posted by Travis at 10/25/2005 1:48:05 AM
Hi , If I create a view consist of this query "Select Sum(Amt) From Table1". Is it increase the performance rather then pass the "Select Sum(Amt) From Table1" SQL statement to the reporting tools ? -- Travis Tan...more >>

Separate values from column
Posted by Mile at 10/24/2005 9:56:08 AM
I working with SQL Server 2000 table called dbo.test. I need to separate value "User Name:xxx" that are in one column named "log" that are space limited. For example I have a column called log and the value = 'domain: User Name:user1 User Name:user2 User Name: User Name:user3'. I want to writ...more >>

English Query still available in SQL Server 2005?
Posted by Miguel Santos at 10/24/2005 6:24:05 AM
English Query still available in SQLServer 2005, or something that implements natural query? -- Miguel Brito Santos...more >>

newbie: how convert nvchar to datetime?
Posted by Jim Muir at 10/23/2005 8:39:39 AM
I have imported a table into msSQL (2000) One of the fields which was stored originally as a simple date field (05/05/05) was created as nvarchar(8). How to I alter this column to become a DateTime field type? I want to do this before I add any more records. The application will be sending...more >>

Matching fileds between two tables
Posted by Daniell at 10/21/2005 3:49:04 PM
I hope I can explain this a little better. I have two tables that I need information from. The first table has all but two fields that I need. I am having two problems. First all I want to do is read the first table take the part number and check the second table. If it is not there I wan...more >>

update in view
Posted by CyberFox at 10/21/2005 3:15:02 AM
I have the following view in my db: SELECT dbo.vw_rptShortagesFG.SalesOrder, dbo.vw_rptShortagesFG.ReqShipDate, dbo.vw_rptShortagesFG.MStockCode, dbo.vw_rptShortagesFG.Style, dbo.vw_rptShortagesFG.ColourCode, dbo.vw_rptShortagesFG.Colour, dbo.vw_rptShortagesFG.[S...more >>

Query on large record
Posted by Daniell at 10/20/2005 11:05:01 AM
First thing I am new to write a query. I have two tables that I need information from. The first table has the user, date and time. The second table has the user, date, time and a record that contains 132 characters. What I need to do is match the user, Date and time along with 7 character...more >>

Help with query formatting
Posted by George at 10/20/2005 6:52:02 AM
Hi all, I have one table that contains, among other fields, a NAME and 14 SERVICE fields. The ID number is obvious and the SERVICE fields contain a "Y" if that particular person (NAME) carries out the service. A person can carry out 1 or more services or the person can carry no service. ...more >>

Simple ranking within group
Posted by AshleyT at 10/14/2005 11:50:08 AM
I have a table that has: sku, vendor_number, vendor_item_number. Right now there are multiple vendor_item_numbers to 1 sku. I need to find just 1 vendor_item_number per sku (doesn't matter which one.) So if I knew how to find the TOP 1 in each group (sku, vendor_number) that would do the...more >>

Error "no value given for one or more required parameters"
Posted by JohnC at 10/13/2005 9:59:48 PM
I just could not figure out what is wrong or missing - here my sample code: Dim horse_recordset As New ADODB.Recordset Dim SQLstmt As String Dim xyz As Integer xyz = 13 SQLstmt = "SELECT [Horse-ID], [Horse Name], [Registration Nummer], [Breed] FROM Horses WHE...more >>

Selecting random rows from a dataset
Posted by dataGirl at 10/11/2005 11:05:12 AM
Question: If I have created a select statement that returns all possible values, can I step through this list using SQL to get a random selection of 10% of the rows? If so, what commands should I be looking at? The closest I've came was to get the top 10%. However, I do not want just the t...more >>

create log file for a scrip
Posted by Lee Ann at 10/6/2005 10:06:16 AM
I'm am new to using SQL Server. In Oracle, when I create scripts to manipulate data, I have a log file automatically created from within the script by issuing the SPOOL command. Is there a similar functionality in SQL server? Besides the log file which records each transaction. Thanks...more >>

Referencing a column from another tables data
Posted by zed500 at 10/5/2005 7:33:12 AM
I have 2 tables Table 1 looks something like this: ID Page1 Page2 Page3 A Trim Scrap Wiring B Plastic Loose Missing Table 2: GroupID Page PageOffset Description A 1 1 Back A 1...more >>

Loop
Posted by Travis at 10/5/2005 12:04:04 AM
Hi , I like to build a query to generate a virtual running number from the table. Something like "Select @X , fieldA from TableA" . The result should look like , @x FieldA -- ------- 1 AAA 2 BBB 3 CCC Please help -- Travis Tan...more >>

How to calculate category value - perhaps use subqueries?
Posted by Hellman at 10/4/2005 10:36:02 AM
Hello all - I am trying to create a view that will calculate a category field value based on several conditions regarding another field. i.e. having a table PayCodes (employeeID, paycode) employeeID paycode ---------------------------- 1 01 1 02 ...more >>


DevelopmentNow Blog