2,935 Topics

Member Avatar for
Member Avatar for NeoKyrgyz

Hi, My project modules are organized in such a way that I have to maintain following Database structure. I've 5 schemas, each containing 20 to 50 tables. Each schema is accosiated with one module of the project. All the tables that are used within more than one modules are kept …

0
148
Member Avatar for princekool

Hi guys; I need your assistance. I am extracting some info from my database and I need difference between two fields of money values. Lets call the fields as Field1,Field2,& Field3. Field1 = Current Balance Field2 = Starting Balance Field3 = Field1 - Field2 From my query, I get Field3 …

Member Avatar for princekool
0
260
Member Avatar for sumangala

Hi,I want to generate unique ID in the database that has the combination of characters and digits. eg. ab111 and next should be ab112 ,ab113 and so on. Can anybody help me?

Member Avatar for samaru
0
76
Member Avatar for denny42

hello all I have Table1 and table2 table1 design is Name ,varchar amount , decimal table2 design is Name , varchar nominal,decimal how is the statement to find the sum of amount in table1 plus the sum of nominal in table2 ? thank you denny

Member Avatar for denny42
0
88
Member Avatar for koncuk

Hi, MS SQL 2005 I'm trying to write a stored procedure.Weighted average cost related to accounting.An area where the data from one field if the date is 01.01. There is no problem. But history is different from 01/01 with the calculated formula into another value equal to the previous day.If …

0
52
Member Avatar for Cha0sBG

Hello dear daniweb experts, i was searching over the web and couldn't find any good explenation on how to write properly to a Microsoft SQL server database, so i decided to ask the experts here: How to properly write to the sql database: i used this snipped to read: [CODE]//Start …

Member Avatar for rajabhaskar525
0
167
Member Avatar for MSnewbie

I am trying to write my first sproc that inserts values into a table. These values will be entered by the user and stored in a variable . They will then be added to the database. This is what I have come up with so far. I can't seem to …

Member Avatar for yosepha
0
116
Member Avatar for xxmp

I have this table publication_en Field Type related varchar(200) public_area int(11) title text detail text file varchar(200) and i am trying to do this INSERT INTO publication_en (related, public_area , title , detail , file) VALUES ('none','1','"helped"','la' "kajakjajk"','J3.pdf') but it doesn't work any idea why it doesn't work ? Thank …

Member Avatar for xxmp
0
96
Member Avatar for vuyiswamb

Good Day All I have an Sp and UDF. the UDF cant take #tables. so i want to incorporate the functionality that is being provided by the udf and make it part of the code. the first part of my statement creates a solid table that is being used in …

Member Avatar for vuyiswamb
0
211
Member Avatar for NextCom

Many people would probably think this question is stupid, but how can i insert a value that starts with 0 in a Bigint/Numeric/Int field? This would normally not be a problem, just using a varchar field instead, but because of the index speed (this is a very large table with …

Member Avatar for mail2saion
0
89
Member Avatar for hitro456

Hi everyone, I have a query as - [COLOR="Red"]select DateName(Month,Date), avg(NetAmount) as AverageCustomerBill from salesmaster group by DateName(Month,Date)[/COLOR] which gives result as follow - [COLOR="Green"]April 451.5664 August 432.6227 July 441.1437 June 429.9915 May 423.7198 November 407.4123 October 425.1684 September 416.3678[/COLOR] As u can see here Months are not in proper …

Member Avatar for hitro456
0
151
Member Avatar for Paser

the deal is to create trigger(function?) which would send updated value from one table and add to another example: table1 column:AccountID and 2 column: Money table2: column:AccountID and 2 column: Money i create something like this: [code]CREATE TRIGGER money_from_vault ON table1 FOR UPDATE AS DECLARE @Money Int,@AccountID varchar(10) SELECT @Money …

Member Avatar for Paser
0
124
Member Avatar for Saba9

[CODE]select distinct cust.no, cust.branch, cust.name, cust.surname, term.benefit, term.code,tehi.trcode, tehi.trancode, dmhi.trancode, dmd.benefit from cust as cust inner join term as term on cust.rowno = term.rowno_custterm_cust inner join tehi as tehi on term.rowno =tehi.rowno_termtehi_term inner join dmd as dmd on cust.rowno =dmd.rowno_custdmd_cust inner join dmhi as dmhi on dmd.rowno =dmhi.rowno_dmddmhi_dmd group by …

Member Avatar for jbisono
0
102
Member Avatar for scias23

i have supertype-subtype: supertype: document subtype: clearance, sedula this query: [CODE=mssql] SELECT Document.DocNo, (Person.Givenname + SPACE(1) + Person.Middlename + SPACE(1) + Person.Lastname) AS Name, Person.Address, CASE WHEN DATEADD(YEAR, DATEDIFF (YEAR, Person.DOB, CURRENT_TIMESTAMP), Person.DOB) > CURRENT_TIMESTAMP THEN DATEDIFF(YEAR, Person.DOB, CURRENT_TIMESTAMP) - 1 ELSE DATEDIFF(YEAR, Person.DOB, CURRENT_TIMESTAMP) END AS 'Age', Person.Status, Person.Picture, …

Member Avatar for jbisono
0
159
Member Avatar for hitro456

Hi Everyone, I have a query as - [COLOR="Red"]select top 10 bm.name, sum(sd.Amount) as bd from brandmaster bm join lobattributevalue lob on bm.brandid = lob.valueid and bm.lobid = lob.lobid join salesdetail sd on sd.productid = lob.productid where lob.attributeid = 3 group by bm.name order by bd desc[/COLOR] Now In this …

Member Avatar for jbisono
0
104
Member Avatar for scias23

i have a supertype-subtype: supertype: DOCUMENT subtypes: CLEARANCE, TAX CERTIFICATE, RECEIPT, BUSINESS CLEARANCE each clearance subtype may have a TAX CERTIFICATE, how could i join using join? in other words, document>clearance document>tax certificate i want to join document>clearance and document>tax certificate into a SINGLE view help. thanks

Member Avatar for jbisono
0
230
Member Avatar for muthu1802
Member Avatar for muthu1802
-1
86
Member Avatar for strunful

Hi there my first post :), i've started a project that transforms a table from SQL to XML, works like a charm.Now i want to transform from a XML file to database: 1)search if there is a database created(i've done that using try catch) if not create a database XMLReader …

Member Avatar for strunful
0
178
Member Avatar for kained

I am trying to help a friend make a database(and ultimately piece of none commercial software) to determine personality type as part of his thesis. For the formula to work properly a couple of the questions need their values inverted(ie if the person answers 1 the recorded number will have …

Member Avatar for samaru
0
117
Member Avatar for kalpa23

i m using sql 2000 and i have a table with 3 columns ( credit , debit, total) what i want to do is whenever a value is inserted to the credit column it should add that amount to the total column and whenever there is a debit value it …

Member Avatar for apegram
0
122
Member Avatar for geek_till_itMHZ

Iam writing (or trying to write) a simple join query statement in Query Analyzer. As of right now Im getting the error message Ambiguous column name 'categoryID'. My Statement is ; [code=sql]Select categoryID, Max (StockPrice) as maxStockPrice, MIN(StockPrice) as minStockPrice, AVG(StockPrice) as avgStockPrice From Category, InventoryPart Where Category.CategoryID = InventoryPart.CategoryID;[/code] …

Member Avatar for princekool
0
156
Member Avatar for dipankar.

Hello every one i downloaded [B]"microsoft sql server 2005" [/B]and installed it correctly but i m now confused b'coz i can't find [B]Query Analyser[/B].Can any one help me out of the situation .

Member Avatar for dipankar.
0
142
Member Avatar for yuhe

HI, I have a table which has hundreds column which are boolean value. I need select from the table based on passing parameter which column, (will set this column value = true) How i write a store procedure which accept the column name as parameter, then based on this to …

Member Avatar for samaru
0
79
Member Avatar for pawangargmit

We are using SQL Server 2005, and saving Hindi, English, Japaneese, Chiness languages in nText column. This all we are doing using google analytical. However, we don't know how to know which value is Hindi or Englsh as they are encoded. Please suggest how to write a query to know …

Member Avatar for kvprajapati
0
132
Member Avatar for appleglaze28

I have a question I want to query a datamart with transactional data. I have 3 fields the unique one is the product. I want to get a query where i set a number from the range of how many unique item there is on field three against field 1 …

Member Avatar for kvprajapati
0
36
Member Avatar for teetime3

I need to display multiple fields but need to restrict by the last entry for each individual. SELECT SSAN, Location, Date_of_Trip from TblTRIPS Where ...only want to select the most recent trip Need help with this. How can I restrict the select statement to the most recent trip for each …

Member Avatar for kvprajapati
0
62
Member Avatar for Helium

Hi I have a table with two columns (ID,ROW) I need to make the ID COLUMN unique and increase it value by 1 for each row. ----------------------- ID ROW 1 NULL 1 NULL 1 NULL 1 NULL How can I replace the each 1 with sequentially increased value? to be …

Member Avatar for apegram
0
152
Member Avatar for H4voc

OK, this may not be possible in SQL, but here goes. I'm writing an app that allows the end user to select a date range and filter by area code, but I want them to be able to select as many area codes as they want. My question is with …

Member Avatar for apegram
0
67
Member Avatar for zachattack05

It's been a while since I've posted. Things have been going well for my project, but I'm coming back to the issue of setting up a SQL server on my user's computers. Sknake was kind enough to give me the command line switches to get a MSSQL install set up …

Member Avatar for zachattack05
0
168
Member Avatar for lebanese007

hi all, i have a database called DB with a table called Menu_reporting that logs when the user selected through calling the server (See below) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USE [DB] GO /****** Object: Table [dbo].[Menu_Reporting] Script Date: 01/31/2010 17:07:26 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO …

Member Avatar for JuhaW
0
109

The End.