2,736 Topics

Member Avatar for
Member Avatar for gsc1ugs

Hi I have this data [code] CustBid idProduct bidAmount bidDate 1 272 165.00 2009-11-20 09:05:31.640 1 272 155.00 2009-11-20 09:05:25.480 4 272 95.00 2009-11-19 12:40:44.973 4 272 85.00 2009-11-19 12:40:40.377 1 272 85.00 2009-11-12 11:20:52.400 1 272 85.00 2009-11-12 11:20:52.400 4 272 75.00 2009-11-12 11:11:02.080 1 272 65.00 2009-11-12 11:20:20.170 …

Member Avatar for gsc1ugs
0
182
Member Avatar for Tank50

I use SQL Server 2005 and I create function.Below I mention the Function that I created. [CODE] CREATE FUNCTION dbo.udf_GetCountryID(@Name varchar(50)) RETURNS VARCHAR(1000) AS BEGIN Declare @Description varchar(4000) select @Description = coalesce(@Description + ',' , '' ) + countryCode FROM dbo.Test_Table where CommonName='Japan' Return @Description END[/CODE] After creating function I …

Member Avatar for Tank50
0
218
Member Avatar for kardsen

I am trying to write a query in my .net app and I'm having trouble pivoting the table since the columns are generated dynamically (based on a month range selected by the user) [CODE]SELECT SUM(HEALTH_MTTR) AS MTTR, SUM(HEALTH_OTR) AS OTR, SUM(HEALTH_REPEAT) AS REPEAT, SUM(HEALTH_CHRONIC) AS CHRONIC, SUM(HEALTH_TOTAL) AS TOTAL, (CAST(CAST(YEAR([DATE_RESOLVED_FOR_CLOSURE]) …

Member Avatar for kardsen
0
129
Member Avatar for mm4215

hai all i am facing some problem in SQL.I am searching the one string(ex.roll-over) in table its returning wrong results. my table contains, dable datas table_1 is table name number1 text1 1 notify us the day you roll check over. 2 notify us theday you roll check . 3 notify …

Member Avatar for thecheesewheel
0
126
Member Avatar for renu_kj

Hi I have a column named 'ExtRefNo' which of varchar datatype. The values can be numbers alone(eg; 101) & values comprising characters & numbers(eg:101A3) My requirement is if the user search for ExtRefNo between 100 & 105, it shud retrieve all ExtRefNos ranging from 100,101,102,103,104 & 105. Need not include …

Member Avatar for renu_kj
0
246
Member Avatar for shariqmsit

DRIEND FRIENDS, I am given a project "hospital administration database" Could you please guide me how to start and proceed. Thanks and Regards. Shariq

Member Avatar for smart77
0
78
Member Avatar for iann

Hi Guys It may be friday, but I am having a real brain fade with this one. I have one table which contains several columns (see below) I need to match names in the tables. The first name is in column childname1 which contains the full name, the column I …

Member Avatar for urtrivedi
0
64
Member Avatar for gsc1ugs

Use this code [code] sql = "SELECT products.endDate FROM products INNER JOIN " sql = sql & " auctionevents ON products.idsupplier = auctionevents.idSupplier " sql = sql & " WHERE (products.endDate > CURRENT_TIMESTAMP) AND (auctionevents.ID = "&id&") AND (products.ListHidden <> 1)" [/code] but if the server is not run the …

0
51
Member Avatar for questionary

Hi. I have a question to advanced SQL programmers/users. I would be very grateful if you could explain me in simple words why we use multiple joins on the same table (for example multiple left outer joins) - what benefits it brings? examples would be appreciated best regards q

Member Avatar for MeSampath
0
148
Member Avatar for carobee

Hi, I have created a temporary @table and while inserting ,i am using dynamic sql.But this is not getting executed and throws an error that "EXECUTE cannot be used as a source when inserting into a table variable" i am using SQLServer2005. Dont know where i am going wrong [code] …

Member Avatar for jbisono
0
2K
Member Avatar for cVz

I get the following message when executing a stored procedure. [COLOR="Red"]The query has exceeded the maximum number of result sets that can be displayed in the results grid. Only the first 100 result sets are displayed in the grid.[/COLOR] However , i cannot change the fact that the SP uses …

0
99
Member Avatar for farhan111
0
49
Member Avatar for xirosen

Hi,,, we have a database grown too fast... from 19GB last march 09 into 52GB this Nov 09... I search through internet on what happen why do database grow fast and i find nothing,, i found out on how to "sp_spaceused" query and the result says: database_name database_size unallocated space …

Member Avatar for GrimJack
0
69
Member Avatar for TJGreene

I'm currently studying SQL and have created two tables (Orders and Inventory). I have been trying to create a trigger on the "OrderDate" column of the Orders table to update the Cur_Stock value (to subtract the Quantity ordered from the Cur_Stock) on the Inventory table whenever a new Order is …

Member Avatar for TJGreene
0
724
Member Avatar for Likethatjazz

Hi all, i use mssql 2005 I have a doubt, how to create a schedule for a query to run every day,the result should be saved every time the query runs, into a new file For the moment I use SQL Server Agent to do this daily, with a jobtask …

0
52
Member Avatar for xirosen

Hi,, i am a newbie in SQL server.. we have a database in our office.. I notice that since 2004 - 2008 our database growth was about 19GB, but since jan. 2009 to present our database grows from 19GB to 52GB... is there's something wrong happening in our database's configuration? …

Member Avatar for xirosen
0
128
Member Avatar for vuyiswamb

Good Day All i have the Following that table [CODE] ID | ACTV |VENU |STUD | TRIES ===================================== 1 1 4 162 0 2 4 5 104 0 3 8 5 138 0 4 15 2 68 0 5 15 4 291 0 6 21 4 171 0 7 22 …

Member Avatar for urtrivedi
0
177
Member Avatar for tactfulsaint

hello everyone, i need a code snipet that can help me retrieve username and password and to authenticate the password in the database..

Member Avatar for truth4life
0
170
Member Avatar for asmikwen

Hi, I am trying to transfer some data from a Mysql database onto a Microsoft SQL database. I would need your help on how to operate this migration as I am new to MSSQL. I have been looking on Google but there are not a lot of pages on that. …

Member Avatar for bgkalbente
0
277
Member Avatar for londonstan

If i have some xml in the form [code=xml]<root> <a>hello</a> <b> <bi>hiya</bi> <bii>hey</bii> </b> <c/> <d>hello again</d> </root>[/code] how can I a) count the nodes? i.e. a, b, bi, bii, c, d so 6 b) count the nodes that are non empty a, bi, bii, d so 4 ? i …

0
48
Member Avatar for _taz_

I have a query that works, I wanted to add another sum from another table, but when I do, the all the SUM values are wrong this works [CODE]SELECT Clients.ClientID, Clients.WholeName, SUM(CASE WHEN Payments.Creditorid = 0 THEN Payments.Amount ELSE 0.00 END) AS 'Admin Fees', SUM(CASE WHEN (Payments.Creditorid = 3) THEN …

Member Avatar for _taz_
0
169
Member Avatar for shibbard

Hi all, I have a single table with both parent and child nodes, and each has an order number in it. I am trying to write a single query to output them in order, its for a navigation list with categories and sub-categories. I could manage it in code rather …

Member Avatar for shibbard
0
116
Member Avatar for kegathor

Hi, I have an insert statement that i need to refine...basically I need to trim the first couple of letters of whats trapped inthe field. so e.g. Z:\aaa\1.jpg needs to become aaa\1.jpg Im tried this but its not working [CODE]sImagelink = mid(request.form("Imagelink"),4,len(request.form("Imagelink")))[/CODE] any ideas?

Member Avatar for kegathor
0
118
Member Avatar for Tank50

Hi I need a help in SQL,There is table called sales.Its contains the day,sales quantity.If I write sql like below [CODE]select day,Sales_quantity from Sales.[/CODE] Then result should be Day SalesQuantity Monday 20 Monday 302 Monday 50 Tuseday 30 etc.. The problem is I want to get result like below Day …

Member Avatar for huangzhi
0
120
Member Avatar for webwiredit

Hi all... So, I am needing to sum all billable hours within a table... the problem is that it is returning rouded decimals instead... like .5 always comes back as 1 ... Here is my procedure: [CODE] Public Shared Function GetBillableTimeForTicket(ByVal SupportTicketID As Integer) As Decimal Dim conn As New …

Member Avatar for webwiredit
0
240
Member Avatar for Geekitygeek

Hi, this is giving me a major headache and my boss wants the project wrapped up asap : / I have two views pulling data from several tables. The end result is this: CustomerTotals CustomerID numeric(18,0), ProductID numeric(18,0), Delivered numeric(5,0), Ordered numeric(5,0) SupplierTotals SupplierID numeric(18,0), ProductID numeric(18,0), Delivered numeric(5,0), Ordered …

Member Avatar for Geekitygeek
0
129
Member Avatar for Rebel1

Hi, I am doing a project where i am creating a website with a SQL server 2005 DB in the backend. I am doing it using visual studio.net and coding in C#, ASP.NET & CSS. As a person registers on the website, the info goes to the DB but i …

Member Avatar for MeSampath
0
85
Member Avatar for vuyiswamb

Good Day all i have the Following Query [CODE] DECLARE @CurrentTime DATETIME SET @CurrentTime = CURRENT_TIMESTAMP select tr.Descr [Room], tb.Purpose [Purpose], tb.Description [Description], convert(varchar,datepart(hour,tb.starttime))+':'+convert(varchar,datepart(minute,tb.starttime)) [Start Time], convert(varchar,datepart(hour,tb.endtime))+':'+convert(varchar,datepart(minute,tb.endtime)) [End Time], tu.name [Requested by] from tbl_booking tb inner join tbl_resource tr on tb.resources = tr.id inner join tbl_user tu on tu.id = …

Member Avatar for vuyiswamb
0
86
Member Avatar for wchitamb

I am trying to write a bulk import routine so that i will be able to import text files or csv files to SQL i have tried this and it's giving me the following error message. P: is the drive where the file is in currently. [CODE] USE [XYZABQ] GO …

Member Avatar for MeSampath
0
123
Member Avatar for mattlightbourn

Dear all, I’m stuck on a problem which I’m hoping someone might be able to help with in an SQL script. I have a table with RAW Timesheet data which includes entries for Absences. When someone enters a timesheet on a particular date for a two week holiday, if I …

Member Avatar for mattlightbourn
0
153

The End.