713 Posted Topics
Re: > 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 … | |
Re: 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 … | |
Re: Wouldn't this: http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.strings.strconv.aspx do the same job if used with VbStrConv.ProperCase? | |
Re: 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 … | |
Re: Read here: http://www.daniweb.com/software-development/vbnet/threads/375191/translating-text | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 | |
Re: 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? | |
Re: 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] | |
Re: 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 … | |
Re: 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? | |
Re: 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 "+ … | |
| |
Re: @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 = … | |
Re: 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 … | |
Re: 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 | |
Re: 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. | |
Re: 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. | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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. | |
Re: 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 | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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> ? | |
Re: why not just go with : insert into customer(customerid, customername) select max(customerid) + 1 , 'test' from customer | |
Re: 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 … | |
| |
Re: 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 … | |
Re: @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 … | |
Re: 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 … | |
Re: @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 … | |
Re: congratulations on your spam bot. | |
Re: Read here: [url]http://www.w3schools.com/sql/default.asp[/url] | |
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. … | |
Re: Please make your condition a bit clear. Without a clear condition no suggestion can be made. | |
Re: 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 … | |
Re: 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 … | |
Re: 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. | |
| |
![]() | Re: I'm guessing that the problem is that you need to join your 2 tables with both stable and comp columns. ![]() |
Re: 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 … |
The End.