- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 13
- Posts with Upvotes
- 11
- Upvoting Members
- 5
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
60 Posted Topics
Re: When I did my final project instead of trying to think of an aimless program that hundreds of other students have already done and will just be scrapped the second it was graded. I found a small charitable organization in my city and offered my services. Small organizations always need … | |
Re: Just insert the getdate(). If you want specific date formats look up the CONVERT function. [code=sql] Insert into Table (date) Values(getdate()) [/code] | |
Re: Try This 1. Select Student,sum(case When Credit > 2 and Score > 10 Then 1 else 0 end) as NumPasses 2. From MyTable | |
Re: I have question. How were these records imported into the table in the first place? It would have been easier to parse them correctly when they were initially loaded. | |
Re: There are alot of ways to do this here are a couple examples. Using Year() function [code=sql] Select sum(Salesamount) From Table where Year(salesdate) = Year(@userInput) [/code] using Date functions [code=sql] Select sum(Salesamount) From Table where salesdate between DATEADD(yy,DATEDIFF(yy,0,@userInput),0) --'First Day of Year' and DATEADD(ms,-3,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,@userInput)+1,0))) --'Last Day of Year' [/code] | |
Re: There is no Top in Oracle. That is SQL Server syntax. | |
Re: BIDS is part of Visual Studio not SQL Server. | |
Re: Try something like this. [code=sql] SELECT DISTINCT emp.Job_ID, a.Employee_ID, a.Last_Name FROM Employees emp Join (Select job_id,employee_id,Lastname From Employees)a on emp.Job_id = a.Job_id ORDER BY a.Last_Name [/code] | |
I have an app where I keep getting this error. This is a c# .net 3.5 app running on a windows 2003 server with IIS 6.0 connecting to an Oracle 10g db. This app had no problems during testing where it was connecting to an Oracle 9i DB but once … | |
Re: What you are asking doesn't make sense, this is a [B]relational database[/B]. If there is no relation in Table 1 with the Data you want in Table 2 then why would you try to access it using Table 1. What happens when someone deletes row 4 in Table2. | |
Re: Try This [code=sql] SELECT Projects.BIMinspector, Sum(NZ(Projects.R9,0)) AS SumOfR9 FROM ProjectsGROUP BY Projects.BIMinspectorHAVING (((Projects.BIMinspector)=[forms]![Form Report]![Elist])); [/code] | |
I am creating a gridview dynamically using Itemplate but I have run into an issue where the event handlers I create for my drop down boxes in edititem template are accumulating every time it fires. To be more specific. When I enter edit mode and select a new item in … | |
Re: You don't directly use triggers in a C# app. If you have a trigger on update for the Student table it will be triggered when you send an update statement from your code. If you want the db to do jobs before an update put this code in a stored … | |
Re: This question should have been posted in the VB forum. Here is a page that explains the basics of connecting to sqlserver from VB. [url]http://www.vbexplorer.com/VBExplorer/vb_feature/june2000/Database_Beginner_ADO_DAO.asp[/url] | |
Re: If statements can not be used within a select statement. Not quite sure what you are trying to achieve here but you could sum a case statement to increment a value. [code=sql] Select abc.value as 'Name', sum(case when (History.OLDSTR == '' and History.NEWSTR == value) then 1 else 0 end) … | |
Re: Why don't you insert the records into the new table with something similar to this. It will create one row per carId and fill in the appropriate property values. [code=sql] Insert into newTable(CarId, Size, Name, Color) Select a.CarId, (Select Propertyvalue from oldTable b where b.PropertyName = 'Size' and b.CarId = … | |
Re: @arjun0 - If you want your questions answered you need to start a new thread. | |
Re: You can't use the alias in the boolean test plus you should use a having clause to test the count(*) and not the where clause. [code=sql] Select title, count(*) As Cnt From poss_titles Group By title Having count(*) > 1 Order By count(*) desc [/code] as for only showing fields … | |
Re: You can use this to get current date at midnight. [code=sql] Select to_char (trunc(SYSDATE), 'MM-DD-YYYY HH:MI:SS') from dual; [/code] Just google Oracle Date functions if you want something more specific. | |
Im currently working on a gridview built using Itemplate at runtime. When in edit mode I use dropdownlists for some of the control fields which are populated from views in my db. The problem I am finding is I usually have a memberID field and a MemberName field and need … | |
Re: Try using select into [code=sql] Select :NEW.sno, UPPER(:NEW.sname), :NEW.class into sno1, sname1, class1 from dual; [/code] | |
Re: Try this [code=sql] Select a,b,c,d,e,f from ( (SELECT a, b, c, d, e, f, DATE FROM table1 WHERE a=10 AND b=1) UNION (SELECT a, b, c, d, e, f, DATE FROM table1 WHERE a=11 AND b=1) ) ORDER BY DATE DESC[/code] You need to encapsulate the whole union to order … | |
Hi, I am working with the gridview in .net 3.5 and have run into something I can not explain. I am testing my delete methods when I realized that the row was actually being deleted before my event handler even finished processing. Am I dreaming or just missing something. I … | |
I am just wondering if there is a way to stop my paging images from moving around the gridview footer when using the builtin gridview paging control. | |
Re: I beleive you need to use a full outer join with a coelesce on the 3 keys to get your desired result. [code=sql] SELECT coalesce(a.Recordingid,b.recordingid), coalesce(a.Connection,b.Connection), coalesce(a.Sequenceno,b.Sequenceno), b.Code, b.Cause FROM dbo.Table_1 a Full OUTER JOIN dbo.Table_2 b on a.recordingid = b.recordingid AND a.connection = b.connection AND a.Sequenceno = b.Sequenceno [/code] | |
| |
Re: I have been getting the same error as well on an app I am working on. I have not been able to find much information on the actual problem but my connection is still working and I am receiving data back from my db but I am not sure if … | |
Re: Did you try using wild cards. [code=sql] Select * from Table1 Where Name LIKE ('%' + @Name + '%') [/code] | |
Re: It is always faster accessing 1 table instead of multiple tables. Not quite sure what else you want in the table but try something like this would most likely be best ID Code Code_Description ...Other fileds 1 Status desc 2 Title desc .... | |
Re: You should be able to clean it up during import with a SSIS package if you know how or else you can do a batch load into a temp table and then clean it up when inserting into maintb. Since you have a reference table you can use s select … | |
Re: The first question I have is why are you using a cursor just to fill a temp table when you can simply fill the temp table with your select statement. [code=sql] Select emplid, name, division, payroll_sect Into #tableMain FROM tblRecords a WHERE ((Finalized = 0) or (Finalized = 1 and … | |
Re: @yangski The user said he was using express which does not include SSIS which is used for the import wizard. The link Sknake provided has a blog on the subject and some possible solutions. | |
Re: The first thing you need to do is replace the left join with an Inner join. Right now you are joining all the customers even if they do not have any orders which is a waste of resources when you are looking for the customers that rank in the top5 … | |
Re: I know this thread is a few days old but if you want the top 10 from the combined list you just sort the list after the unions not for each table. [code=sql] (SELECT * from table_a ) union (SELECT * FROM table_b) union (SELECT * FROM table_c ) order … | |
Re: I think the best way is the syntax you feel more comfortable with. I like the old joining syntax using the where clause but alot of people like the new syntax, I believe because of readability especially on outer joins where it shows in regular text that you are performing … | |
Re: You should use code blocks as it makes it alot easier to read. [code=sql] [/code} Did you try an inline view? something like this maybe [code=sql] select distinct c.name as 'Company Name', ss.name as 'Program' ,a.application_number as 'Application Number' ,a.sites as 'Site Count' ,convert(varchar(10), a.accreditation_start_date, 101) as 'Start of Accreditation' … | |
Re: At my previous company we also resorted to using dotdefender after we came under a serious sql injection attack. The product worked very well and we were able to get it up and running very fast. It took a few more weeks to modify the product to not block some … | |
Re: Schedule a job to run the script at whatever interval you want. | |
Re: I think you want to try a query like this [code=sql] SELECT Count(*) FROM Orders WHERE signNumber = ? (AND ? BETWEEN fromdate and todate Or ? BETWEEN fromdate AND todate) [/code] You need to use the OR condition or else both conditions have to be met when you want … | |
Re: If you are inserting data from other tables you can use a select statment [code=SQL] Insert into customer(c_id,c_name,c_city,c-street) Select c_id, c_name,c_cit, c_strett From Table(s) Where Conditions [/code] | |
Re: Just use a join query. Sub query to just pull fields is not required. [code=sql] Select a.Seq, a.An, a.NET_Id, a.DES, b. Short From Activities a, Codeset b Where a.R11 = b.code [/code] | |
Re: I don't know too much about Rule Objects but did you run sp_bindrule to bind the rule to the your coluum. | |
Re: I think we would need a little more details to what you are asking. Do you want a list of all customers that purchased a specific product in the current month only IF they had purchased the same product in the past 11 months? The product will be a provided … | |
Re: do you mean something like this [code=SQL] Select field2,count(Field1) From Table Group by field2 [/code] | |
Re: Pee, Sknake is one of the most helpful posters here. He asked simply that you provide him with a create statement and sample data so he can provide you with a thorough solution for your problem. Everyone here has their own work to do so it is the requester's responsibility … | |
Re: Natural Joins can be used in Oracle, but I have never used them. They are like using the 'on' or 'using' construct for inner joins but the construct will distinguish which fields are the same and join them so you do not need to explicitly name them. Your DB has … | |
Re: I don't see where you are getting the alias 'c' Besides that i think you are making it more difficult then it has to be. [code=sql] select * from dbo.tblLevelOneApprover a, dbo.tblLevelTwoApproverToLevelOneApprover b Where convert(int, b.level_two_emplid) <> convert(int, a.emplid) [/code] | |
Re: you need to explain what you are trying to do a little clearer. If you actually mean you want to give the user alter control in your database to add their own fields to your tables this is very bad practice and should never be done. If what you actually … | |
Re: [code=SQL] Select Product From Table Where Component in ('part1','part3') [/code] |
The End.