Posts
 
Reputation
Joined
Last Seen
Ranked #416
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
13
Posts with Upvotes
11
Upvoting Members
5
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
7 Commented Posts
~55.2K People Reached
Favorite Tags

60 Posted Topics

Member Avatar for jayfaj

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 …

Member Avatar for Nimric
0
962
Member Avatar for Gaurav arora

Just insert the getdate(). If you want specific date formats look up the CONVERT function. [code=sql] Insert into Table (date) Values(getdate()) [/code]

Member Avatar for Timothy_3
0
212
Member Avatar for gbhs

Try This 1. Select Student,sum(case When Credit > 2 and Score > 10 Then 1 else 0 end) as NumPasses 2. From MyTable

Member Avatar for cgyrob
0
283
Member Avatar for Scotto13

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.

Member Avatar for gbann123
0
257
Member Avatar for 21KristianN

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]

Member Avatar for kplcjl
0
5K
Member Avatar for achiman
Member Avatar for S2009
Member Avatar for Billingsley

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]

Member Avatar for Quacau corp
0
23K
Member Avatar for cgyrob

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 …

Member Avatar for cgyrob
0
201
Member Avatar for Rottieman

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.

Member Avatar for Rottieman
0
118
Member Avatar for mela1006

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]

Member Avatar for cgyrob
0
67
Member Avatar for cgyrob

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 …

Member Avatar for cgyrob
0
127
Member Avatar for AnkitKumar

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 …

Member Avatar for AnkitKumar
0
4K
Member Avatar for rakky

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]

Member Avatar for AndreRet
0
138
Member Avatar for Abhishek_Boga

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) …

Member Avatar for Abhishek_Boga
0
144
Member Avatar for Julamotte

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 = …

Member Avatar for cgyrob
0
101
Member Avatar for culbysl
Member Avatar for debasisdas
0
3K
Member Avatar for benkyma

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 …

Member Avatar for benkyma
0
187
Member Avatar for dotNetDummi

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.

Member Avatar for cgyrob
0
116
Member Avatar for cgyrob

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 …

Member Avatar for cgyrob
0
112
Member Avatar for john_beginner

Try using select into [code=sql] Select :NEW.sno, UPPER(:NEW.sname), :NEW.class into sno1, sname1, class1 from dual; [/code]

Member Avatar for john_beginner
0
147
Member Avatar for Venom Rush

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 …

Member Avatar for Venom Rush
0
93
Member Avatar for cgyrob

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 …

0
63
Member Avatar for cgyrob

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.

Member Avatar for cgyrob
0
63
Member Avatar for milenio

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]

Member Avatar for Ezzaral
0
124
Member Avatar for wil0022
Member Avatar for moorcroft

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 …

Member Avatar for cgyrob
0
111
Member Avatar for Aussie_Here

Did you try using wild cards. [code=sql] Select * from Table1 Where Name LIKE ('%' + @Name + '%') [/code]

Member Avatar for Aussie_Here
0
117
Member Avatar for ditjhaba

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 ....

Member Avatar for debasisdas
0
80
Member Avatar for yangski

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 …

Member Avatar for yangski
0
362
Member Avatar for Link82

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 …

Member Avatar for cgyrob
0
1K
Member Avatar for oddvalue

@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.

Member Avatar for cgyrob
0
242
Member Avatar for grin2dan

This should work for you. [code=sql] update employee set salary = case when salary < 100000 then salary * 1.10 when salary >= 100000 then salary * 1.15 End; [/code]

Member Avatar for grin2dan
0
80
Member Avatar for Andy_nexus

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 …

Member Avatar for cgyrob
0
9K
Member Avatar for flashyflashy

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 …

Member Avatar for ebookfinder
0
103
Member Avatar for dbdesigner_2008

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 …

Member Avatar for ferensick
0
125
Member Avatar for KRichardson1127

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' …

Member Avatar for KRichardson1127
0
96
Member Avatar for samaru

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 …

Member Avatar for cgyrob
1
529
Member Avatar for jbd4d
Member Avatar for jbd4d
0
130
Member Avatar for elidotnet

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 …

Member Avatar for elidotnet
0
195
Member Avatar for cutedipti

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]

Member Avatar for anubina
0
120
Member Avatar for parlati

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]

Member Avatar for cgyrob
0
140
Member Avatar for ashkan3030

I don't know too much about Rule Objects but did you run sp_bindrule to bind the rule to the your coluum.

Member Avatar for cgyrob
0
87
Member Avatar for mamtha

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 …

Member Avatar for cgyrob
0
106
Member Avatar for hashinclude

do you mean something like this [code=SQL] Select field2,count(Field1) From Table Group by field2 [/code]

Member Avatar for cgyrob
0
154
Member Avatar for pee2002

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 …

Member Avatar for cgyrob
0
108
Member Avatar for jimbo84

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 …

Member Avatar for cgyrob
0
84
Member Avatar for Link82

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]

Member Avatar for Link82
0
182
Member Avatar for massivefermion

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 …

Member Avatar for cgyrob
0
163
Member Avatar for michael123

[code=SQL] Select Product From Table Where Component in ('part1','part3') [/code]

Member Avatar for cgyrob
0
129

The End.