2,935 Topics
![]() | |
Hi all! Ive created this code to read in data from several tables but i have a problem with SUM. With this code im trying to add together all the null values that have the most recent date but all the SUM commandi have does is multiply the number by … | |
Hi Guys, I have a text file which looks like this 123456 Amanda Morris and I would like it to look like this "123456","Amanda","Morris" The file has about 2000 lines how would I go about inserting the quotes and the commas. I use textpad to open the textfile and I … | |
Hi, I have an average cost greater than price crystal report for 20 different stores. I want to create a master report that lists all of the results over the entire company. Hence, I want to use union all in a SQL command for this master crystal report. For example, … | |
So I got this code off the internet. The guy who made it said this, "I have done this in SQL Server.If u want to do in Acess Database just create a table name USERS then add two fields name user_name and user_pwd thats it." I tried that and it … | |
hi. I'm trying to delete a row by specifying the actual row number. When I call all columns from one table it does work but when I already multiselect them I get an error: [COLOR="red"][I]Msg 4405, Level 16, State 1, Line 1 View or function 'Records ORDERED BY rowID' is … | |
I want to select data from ranges like Column1 Column2 25000 10 50000 20 75000 30 I want records like upto 25000, I get 10 upto 50000, I get 20 upto or more than 75000, I get 30 Can anybody suggest me a simple query for that? Thanks in advance, | |
Why is this script not working.. [CODE] USE [KN_online] GO SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[UPDATE_PREMIUM_SERVICE_USER_EXEC] AS DECLARE @d24 datetime SET @d24 = DateAdd(hh,-24, GETDATE()) UPDATE PREMIUM_SERVICE SET nDays = nDays - 1 where Date > @d24 [/CODE] This is suppose to take 1 day … | |
![]() | Is there a keyword in SQL that would allow you to select a value from a field in the previous row? I am looking for something that would give me the speed field value for the row before: [code]SELECT min(Parsed.Time), [Parsed.Number] FROM Parsed GROUP BY [Parsed.Rev Number] [/code] |
hi i need to store data more than 8000 char in varchar in sql server 2000 how can i? plz help. | |
![]() | Hopefully this will be an easy one for someone. I am trying to write a SELECT statement that pulls the row with the least time for each Special Number. Example data would be: Time Special Number 3:25:00 1 3:26:00 1 3:25:30 2 3:26:30 2 The expected output would be: 3:25:00 … |
I have 2 table in a ms sql database prod_curs_test and rebuturi_test. I want to update some fields in prod_curs_test with data from rebuturi_test. I used this to do that: [code] update dbo.prod_curs_test set dbo.prod_curs_test.cant_rebuturi = (SELECT dbo.rebuturi_test.Cantitate FROM dbo.rebuturi_test CROSS JOIN dbo.prod_curs_test WHERE dbo.rebuturi_test.Comanda = dbo.prod_curs_test.Comanda) where exists (SELECT … | |
This isn't a problem as I have already solved the problem, just trying to figure out why it happened. Ok I have a field that is type money. I wrote a stored procedure that updates this field, however, I made the datatype for the parameter to get passed in a … | |
Hi , I have designed a database that is to create a application simlar to microsoft money The database erd is aattched with this post. The database has following table Invoice Amount Account Profit_center Customer A invoice can sometimes split in to 3 parts therefore i have create table invoice … | |
Hello, I recently bought a new server and I'm trying to move the MSSQL database from the old mssql (MSSQL 2000) to the new system MSSQL Express 2005. I made a .bak file in the old server and restored it succesfuly in the new server. the thing is that it … | |
[B]Is it possible in a query to delete a row specifying its row index?[/B] I want to delete a row from my table. I'm trying to figure this because when I delete rows from my datagridview, it does not update. So I was thinking if I just directly delete it … | |
Hello I seem to be having a problem, I have this query that pulls back correct results [CODE]SELECT hourStamp, SUM(CASE WHEN datestamp < GETDATE() THEN 1 ELSE 0 END) / @numberofdays as HourAverage, SUM(CASE WHEN dateStamp BETWEEN DATEADD(d,DATEDIFF(d,0,GETDATE()),0) AND GETDATE() THEN 1 ELSE 0 END) as HourToday FROM webstats GROUP … | |
Hey guys, I have some question about a query in SQL I'm buliding for my software. This software meant for Bills managing. I have main screen which display all the bills and another screen which display the bill details, this screen built on 3 tables : Bill,BillItem,Payment tables. My question … | |
I'm getting the error Incorrect syntax near '=' when running the following query. I'm fairly new to SQL, but this looks like it's pretty straightforward. Basically, I have a table with smartphone information (A_INV_SMARTPHONE) and a table for Windows CE Pocket PC information (A_INV_WINDOWS_CE). Both tables contain columns for Manufacturer … | |
Hi all, I have a problem achieving the result. I want data as below which is based on 4 tables [B]Expected rasult [/B] SiteID SiteName State PostCode Phone1 StateName CanDelete --------------------------------------------------------------------------------- 1 Site1 1 2134 124 123 - ADC 1 2 Site2 3 2323 124 234 - QTY 0 3 … | |
vista home premium sql server 2005 installer help | |
OK, here's some background. The database I'm receiving an extract from is an in-house call-tracking system. Each call that comes in is assigned a ticket number (TICKET_NUMBER). Each ticket, though, may have several iterations (CALL_LEVEL) based on the number of updates a representative places on the ticket. Each iteration is … | |
I am trying a multi select query in management studio and I am only expecting a result that is a single output per row, however, when I tried executing it. The rows I called repeated once. For example I have 2 rows in my column1 and when I multi-selected my … | |
Hi. Can anyone tell me how to copy data from a table from another database? I was able to copy but I only got the columns and not the data it contains. This is how I copied it: I tried this first: USE MMDA GO SELECT * INTO MMDAserver.Vio.ViolationList FROM … | |
hai friend's i am beginner in MS sql db . so can any one explain me detail about Foreign key and primary key , please give example also , thank;s in advance..... | |
Hi there, I have a master detail set of tables with a one-to-many relationship. Let's call the tables Projects (master) and Markets (details). I need to allow users to query the database and be able to select projects by markets. In other words, users should be able to "say": "List … | |
I have a MSSQL table that contains lots of duplicate records, is there a simple way to keep only one and remove all other duplicates? [CODE] mike M 60 mike M 60 mike M 60 [/CODE] I need only one record [CODE] mike M 60 [/CODE] | |
Not being a SQL programmer please forgive the following but I need to know. I have a MSSQL database with a table containing a row defined as Column Name Data Type Length Turnover decimal 5 also in Enterprise Manager I see Precision is set to 7 and Scale is set … |
The End.