713 Posted Topics

Member Avatar for Dani

> Are you trying to get answers to your own questions? I guess we were all looking for an answer and landed here. > What value do you get from helping people? Sometimes it's satisfaction for a good solution you've come up with, other times a sense of accomplishment or …

Member Avatar for john.knapp
0
272
Member Avatar for Lethugs

It doens't have to complicated with joins or subqueries: SELECT Description.Dgroup AS Description, COUNT(Item.IID) AS TotalCount, sum(case when [Transaction Details].Ttype = 'Repair' then 1 else 0 end) as 'Under Repair' FROM [Transaction Details] RIGHT OUTER JOIN Item ON [Transaction Details].IID = Item.IID LEFT OUTER JOIN Description ON Item.DeID = Description.DeID …

Member Avatar for Lethugs
0
315
Member Avatar for pratik65

Wouldn't this: http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.strconv.aspx do the same job if used with VbStrConv.ProperCase?

Member Avatar for Gé48
0
3K
Member Avatar for cyberdaemon

You can declare a var to hold your query in the declarations part of your form (before the first sub) and a second one to hold your query criteria. This will give your vars scope for all events in this form and allow you to use them in 2 or …

Member Avatar for cyberdaemon
0
131
Member Avatar for Programmer629

Read here: http://www.daniweb.com/software-development/vbnet/threads/375191/translating-text

Member Avatar for Programmer629
0
99
Member Avatar for jay.barnes

Let me see if I got this right: You want to query with min-max for both oct3 & oct4 and get all the possible combinations? I'm guessing that you could do it like this: select oct3, oct4 from (select oct3 from ip_table where oct3 between @oct3_min and @oct3_max) oct3 cross …

Member Avatar for jay.barnes
0
312
Member Avatar for Rachna0309

Inside Access the wildcard is *, but over ADODB you should use % as the wildcard. Give it a try and let us know how it goes.

Member Avatar for adam_k
0
956
Member Avatar for pratik65

I agree with Reverend, but I've got to say that if your error comes from line: `no = no.Substring(2)`, that's because your count(*) returns a single-digit result. If you remove that line, then your code will probably work, although there are errors in it's logic. By error in the logic …

Member Avatar for adam_k
0
782
Member Avatar for niladri.prima

select contact_ID, Magazine_Type from dbo.IA_Subscription a inner join (select contact_ID, count(*) as magazines from dbo.IA_Subscription group by contact_ID having count(*) > 1 ) b on a.contact_ID = b.contact_ID

Member Avatar for adam_k
0
143
Member Avatar for wordtechinc

Can you please explain what you are trying to do, a bit better? What is the "other SP" doing and how is it connected to this table/SP ? Why should this SP return any rows when it's the other SP that is deleting rows?

Member Avatar for wordtechinc
0
285
Member Avatar for mattwagner

I think it's the missing parrenthesis in values. Change your SQL string to : [CODE]SQLstr = "INSERT INTO Users (Username,Password) VALUES ('" & txtUsername.Text & "','" & txtPassword.Text & "')"[/CODE]

Member Avatar for adam_k
0
7K
Member Avatar for purijatin

I'm not sure how you can trigger an event with the CRLF. My guess is that you are using the Worksheet_Change event and in that you verify if the newly entered text ends with \r\n. If this is the case you could remove this test - BUT be warned that …

Member Avatar for adam_k
0
111
Member Avatar for kenomote

That's why you are asked to share your code in the rules. > how do i subtract and add values to each fields for every single transaction on the same table? When you are saying transaction, can you define transaction? Share the code for it?

Member Avatar for kenomote
0
144
Member Avatar for mail.sujitkulkarni

or use UNION to insert multiple records at once: dataCommand.CommandText=(@"INSERT citylist(city_id,city_name,latitude,longitude,state) select 1, 'Port Blair', '11.67 N', '92.76 E', 'Andaman and Nicobar Islands' UNION ALL "+ "SELECT 2, 'Adilabad', '19.68 N', '78.53 E', 'Andhra Pradesh' UNION ALL "+ "SELECT 3, 'Adoni', '15.63 N', '77.28 E', 'Andhra Pradesh' UNION ALL "+ …

Member Avatar for mail.sujitkulkarni
0
3K
Member Avatar for BigPaw

That my friend is not interesting, it's the life of a married man. :D

Member Avatar for <M/>
1
89
Member Avatar for cyberdaemon

@ryantroop: I think you are trying to do this: declare @query varchar(500) declare @criteria varchar(500) if @firstname is null and @gender is null return else if @firstname is not null and @gender is not null set @criteria = ' where firstname like '%' + @firstname + '%' and gender = …

Member Avatar for cyberdaemon
0
128
Member Avatar for kenomote

Should we guess what's wrong with it? Here I go: 1. Declare FineRate as double, string won't do. Also change it in My.settings 2. You calculate daylate, assign it's value to a label and then assign it the value of the label. Can you please explain why you are re-assigning …

Member Avatar for kenomote
0
134
Member Avatar for bayle.nicolas

Try this connection string: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\star\DropBox\\;Extended Properties="text;HDR=No;FMT=Delimited(|)" More info here: http://www.connectionstrings.com/textfile

Member Avatar for bayle.nicolas
0
1K
Member Avatar for Tobyjug2222

Try this, as you are using reserved words for field names Dim SQLSend As String = "UPDATE TblStaff SET [Username]='" & TxtModifyUserUsername.Text & "', [Password]='sdfsdsdf'" & " WHERE [Username]='" & ModifyUsernameOrignal & "'" I'm sure about password, but I'm not sure about username. Anyway brackets won't harm if it's not.

Member Avatar for Tobyjug2222
0
610
Member Avatar for xXghostXx

It is indeed incorrect: Select P_Id, FirstName, LastName, O)Id, OrderName from Persons inner join Orders on Persons.P_Id = Orders.P_Id You don't need a where clause, as the join will eliminate all persons without records in Orders.

Member Avatar for adam_k
0
257
Member Avatar for agr8lemon

1st of all don't hijack old threads. I'd use dynamic SQL to figure out the query, but you are not showing any effort.

Member Avatar for adam_k
0
1K
Member Avatar for savedlema

Reverend's NZ will probably help you, but just to make it clear why sum won't work: Your code: "SELECT SUM (IIF(ISNULL([Physics]),0,[Physics])) As Phy, SUM (IIF(ISNULL([Chemistry]),0,[Chemistry])) As Chem, SUM([Physics])+Sum([Chemistry]) as Total FROM tblForm1 WHERE StudentID = '" & Trim(Me.txtSearch.Text) & " ' " does replace null values in column physics with …

Member Avatar for savedlema
0
1K
Member Avatar for EmpK

If Enflbl is a label in your form then you should use ` Enflbl.visible = true` to show it and `Enflbl.visible = false` to hide it.

Member Avatar for Reverend Jim
0
188
Member Avatar for poojavb

If I am not wrong, you are using the same thread to show the progress bar and run the restore. That's why this isn't working out so well, as the thread is busy with SQL and doesn't get to process your progress bar until it's finished. My suggestion is to …

Member Avatar for Reverend Jim
0
292
Member Avatar for jhedonghae

or just use a `if hh > 1 then hh = hh - 1 else 'whatever you want here` kind of logic before your ` TotalHWTextBox.Text = hh.ToString.PadLeft(2, CChar("0")) & ":" & mm.ToString.PadLeft(2, CChar("0"))` code.

Member Avatar for G_Waddell
0
188
Member Avatar for trishtren

Only the ID appears empty to me, so in order to update that use: update TableB set ID = a.ID from TableA a inner join TableB b on a.ItemName = b.ItemName

Member Avatar for trishtren
0
159
Member Avatar for sourabh.asu

In SQL syntax you could use the following to insert the missing records: insert into table (city, case, case_number, manager, month, monthly_total, fiscal_total) select a.city, a.case, a.case_number, a.manager, b.month_number, 0, sum(monthly_total) from (select distinct city, case, case_number, manager from table) a full outer join (select 1 as month_number union select …

Member Avatar for adam_k
0
613
Member Avatar for kumar.gaurav.7771

Like the post you are mentioning, go to http://www.connectionstrings.com/access-2007 and verify that your connection string is correct: Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\serverName\shareName\folder\myAccess2007file.accdb; The file should already be setup with the required read/write priviledges for the PC2 account under witch your program will run.

Member Avatar for kumar.gaurav.7771
0
248
Member Avatar for kenomote

Try it this way: Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click IF cboSI.Text = "ISBN" Or cboSI.Text = "Title" Or cboSI.Text = "Author" Or cboSI.Text = "Publisher" Or cboSI.Text = "Category" Then Try Dim d3 As New MySqlDataAdapter("select * from tblbooks where " & cboSI.Text …

Member Avatar for adam_k
0
192
Member Avatar for DJSAN10

that would come at a later stage. first you have to figure out the number of records: select A,C,D, count(*) from table group by A,C,D count will be the number of records for each unique combination of A,C,D. If you want to delete all records with count > 100 then …

Member Avatar for DJSAN10
0
98
Member Avatar for bprosic

Can you please share the code where: a) you assign the value to txt1 (whole thing, including event that fires it) b) the update the db part On the plus side: Yes you can, you do the opposite thing (assign the datetimepicker the date from the textbox), but you have …

Member Avatar for bprosic
0
2K
Member Avatar for lanie.mollanida

I guess you'll have to say what you are trying to add, edit and delete. Is it a datagridview? Is it a listview? is it <put any object here> ?

Member Avatar for adam_k
0
139
Member Avatar for Shodow

why not just go with : insert into customer(customerid, customername) select max(customerid) + 1 , 'test' from customer

Member Avatar for adam_k
0
54
Member Avatar for cyberdaemon

The easiest way would be by case: select item, price, case when price > 200 then 20% else 0 end as discount from table_name another way to do it is: select item, price, 0.2 as discount from table_name where price > 200 union select item, price, 0 from table_name where …

Member Avatar for adam_k
0
88
Member Avatar for vinaylucky2
Member Avatar for sanket044

I don't have SQL now to provide the actual query, but you should be able to use ROW_NUMBER() as a key for joining subqueries (ie select distinct fname, row_number() over (order by fname) from table) Remember to outer join, so you won't limit your results to the smallest count of …

Member Avatar for M.Waqas Aslam
0
136
Member Avatar for everettnewell

@vishalrane Your login form is pretty easy to bypass. Change lines 10 - 14 to: [code=vb] dim dc as sqlcommand dc.connection = con dc.commandtext = "select count(*) from Login where UserName ='" &Trim(txtUsername.Text) & "' and Password='" & Trim(txtPassword.Text) & "'") con.open dim result = dc.executescalar if result = 1 …

Member Avatar for Maulikpra
0
539
Member Avatar for M.Waqas Aslam

I'm going to go with UNION, but not like poojavb. I'm guessing that you want the numbers to go under the person's name and poojavb's script won't do that. Instead I'm thinking: select Name as 'a' , Name from Contacts --change table name union select Name, PhoneNo from Contacts inner …

Member Avatar for M.Waqas Aslam
0
250
Member Avatar for Sadia fatima

@BitBlt: I totally agree, but I thought that you could also alter the table and have the identity seed from whatever you need it to. @OP: Unless you clear the contents of the table I strongly suggest against reusing the same IDs - in fact I strongly suggest against it …

Member Avatar for cutepinkbunnies
0
775
Member Avatar for daydie
Member Avatar for geetajlo
Member Avatar for nduduzo
0
192
Member Avatar for adam_k

It seems to me that about the same time that the buttons (Code, Bold, etc) stopped working, the reply box stopped allowing to select text. I've tested with IE and it works as expected, but in Chrome it appears that I can't select any of the text I've just typed. …

Member Avatar for Dani
0
435
Member Avatar for istore221
Member Avatar for adam_k
0
112
Member Avatar for nubie.net

Let's start with error control. Use Try...Catch around your cmd.ExecuteNonQuery(). Then you will be able to handle the error. If you want you can skip the duplicate record and continue inserting or whatever. If that doesn't cover you then I guess you could insert your values in a temp/work table …

Member Avatar for adam_k
0
1K
Member Avatar for jamesbeat64

Since you are trying to add something to an existing program, my advise is to continue with the same philosophy that the program was written in the first place. With that in mind, how you'll handle the cell you are trying to add depends as to how the initial programmer …

Member Avatar for adam_k
0
424
Member Avatar for kishpopboy

put TextBox1.Text and 8:00 into a date and subtract. (datediff will give you the minutes). If minutes are positive (eg 08:05 - 08:00 = 5 ) then multiply them by 1.16 or whatever. If they are negative then he's in early.

Member Avatar for adam_k
0
499
Member Avatar for sangeetha.ar

Well I'm not sure if this is MySQL (as your first sentence says) or MS SQL as the forum you are posting in, but anyway. It seems that you are getting a cartesian product, because you are joining 2 tables without proper keys to make each record unique for the …

Member Avatar for adam_k
0
157
Member Avatar for Riteman
Member Avatar for Borderline

I'm guessing that the problem is that you need to join your 2 tables with both stable and comp columns.

Member Avatar for Borderline
0
144
Member Avatar for asif49

I'm sure that in some cases somebody from HR will read a cv and say "Microsoft, there's a company of our standards" and put that cv in the top of the list. The good thing is that nowadays companies don't hire unless there is a specific need, which brings up …

Member Avatar for adam_k
0
148

The End.