dickersonka 104 Veteran Poster

What type of collation is this?

run this

SHOW FULL COLUMNS FROM assign2;
dickersonka 104 Veteran Poster

Awesome, you happen to know what the issue was with the one we were working with?

dickersonka 104 Veteran Poster

the stop table is only used in the subquery and can't be referenced outside of it

i don't get why, but it looks like the isdrop =1 is not just joining on those records

try adding this piece in as well

inner join
jobxstop jxs
on jxs.isdrop = 1 and jxs.stopid = stop.stopid
dickersonka 104 Veteran Poster

its not late, only 5, just got a few left before work is done though, there is some data in here that isn't jiving

this will do a partial update, but might help determine what is going on

add this bottom line here and then we can see what rows aren't updated

and jh.jobstatusid = 10
and jobhistory.histjobid = jh.histjobid
and stop.stopcompletiondatetime is not null)
dickersonka 104 Veteran Poster

so close, just something in there i'm just not catching right now, one last try for the evening, cross our fingers

UPDATE jobhistory 
SET modifieddt = 
(SELECT top 1 stop.stopcompletiondatetime 
from stop
inner join
jobxstop jxs
on jxs.stopid = stop.stopid
inner join jobhistory jh
on jh.histjobid = jxs.jobid
where jxs.isdrop = 1
and jh.jobstatusid = 10
and jobhistory.histjobid = jh.histjobid)
where jobhistory.jobstatusid = 10
dickersonka 104 Veteran Poster

but all stop.stopcompletiondatetime are not null?

dickersonka 104 Veteran Poster

hmmmm,

run this

select jobhistory.histjobid, stop.stopcompletiondatetime
from jobhistory
inner join jobxstop 
on jobxstop.jobid = jobhistory.histjobid
inner join stop
on stop.stopid = jobxstop.stopid
where jobhistory.JobStatusID = 10
and jobxstop.isdrop = 1

think there might be something funny going on here

dickersonka 104 Veteran Poster

sorry long day already, i didn't have the join on the original table, lets go back to your query the first time with that one line removed

UPDATE jobhistory
SET modifieddt = stop.stopcompletiondatetime
FROM jobhistory
INNER JOIN jobxstop
ON jobxstop.jobid = jobhistory.histjobid
AND jobxstop.isdrop = 1
INNER JOIN stop
ON stop.stopid = jobxstop.stopid
WHERE jobhistory.JobStatusID = 10

does this one complain about the null values?

dickersonka 104 Veteran Poster

i can't completely tell the structure, but i believe this will work, just make sure you do a backup first!!!

UPDATE jobhistory 
SET modifieddt = 
(SELECT stop.stopcompletiondatetime 
from stop
inner join
jobxstop jxs
on jxs.stopid = stop.stopid
inner join jobhistory jh
on jh.histjobid = jxs.jobid
where jxs.isdrop = 1
and jh.jobstatusid = 10)

if it complains about multiple values do a select top 1 from the subquery

dickersonka 104 Veteran Poster

a procedure is not directly associated with a table, it could be a single, multiple, or no tables involved

in the section that says do your work here, lets say we are doing a single insert

create procedure ProcedureName
(
@name varchar (50)
)
as
BEGIN
  insert into TableName (NAME) 
  values (@name)
END

thats how the 'link' happens so to speak with tables

dickersonka 104 Veteran Poster

Is it in the maintenance plan or a schedule task to do so?

My advice would be to create a maintenance plan to create the backup, and a scheduled task to compress it and ftp it

I don't understand completely where the problem is residing

dickersonka 104 Veteran Poster

you have this in here
INNER
JOIN stop
ON stop.stopcompletiondatetime = jobhistory.modifieddt

which will not work, because stopcompletiondatetime does not equal your modifieddt

dickersonka 104 Veteran Poster

Add an additional parameter for your id, this will return the newly inserted record's id, otherwise if it failed an exception will be thrown and you don't need to check for its existence

CREATE PROCEDURE CreateWebsiteMember
(
@wbmName varchar(50),
@ID int OUTPUT
)
AS
Insert into tblWebsiteMember (wbmName)
values (@wbmName)

set @ID = SCOPE_IDENTITY()
dickersonka 104 Veteran Poster

in management studio you can use object explorer, open your database (expand), go to programmability right click on stored procedures and click new stored procedure

you can also do it manually by this

create procedure ProcedureName
as
BEGIN
... do the work here
END
dickersonka 104 Veteran Poster

you can just use a '+' (plus sign) if they are two string fields

i added a space in between the fields as well

select db1.dbo.customer.technote + ' ' + db2.dbo.customers.notes as FULL_NOTE
--put the rest in here
dickersonka 104 Veteran Poster

The exe is the compiled solution, all exes have already been compiled as well

if you are in a winforms app, it needs to be compiled before running it, if you are in asp.net you can set the project not to be built until specifically build the project

if your project is getting to be that large, then possibly separate your reference dlls out into a separate solution, and build those when necessary, and have the main app reference the dlls rather than projects

alc6379 commented: very good real-world use case here. +12
dickersonka 104 Veteran Poster

In the past I have used SharpZipLib

http://www.icsharpcode.net/OpenSource/SharpZipLib/

dickersonka 104 Veteran Poster
select p.ID,
(SELECT SUM(i.IncomeAmount) from Income i where i.PersonId = p.ID) AS INCOME_AMOUNT,
(SELECT SUM(o.OutcomeAmount) from Outcome o where o.PersonId = p.ID) AS OUTCOME_AMOUNT
from Person p
dickersonka 104 Veteran Poster
select top 3 *
from tableName
order by col3 desc
bharatshivram commented: thanx for your reply. +2
dickersonka 104 Veteran Poster

I'll help out, but you just need to tell us what you want, if you want to compare ips then say that, not about how to create a socket

you are trying to compare objects with clientsocket.equals

you can use

clientsocket.getInetAddress().getHostAddress().equals("192.168.1.5")
dickersonka 104 Veteran Poster

use formatting

//you set your data here
decimal numValue = 20.0000;

//format it here
string num = String.Format("{0:C}", numValue);
this.textbox.Text = num;
dickersonka 104 Veteran Poster

you can use something like this

int port = 8000;
String ipAdd = "192.168.100.5";
int timeout = 1000;

SocketAddress sockAddr = new InetSocketAddress(ipAdd, port);
Socket s = new Socket();
s.connect(sockAddr, timeout);
dickersonka 104 Veteran Poster

as long as the dns can resolve the hostname you can use the name in place of 'localhost' as well, this way if the ip ever changes it will still resolve to the correct address

dickersonka 104 Veteran Poster

At peak times our currently active users would be around 500 or so and have ran into no limitations yet with the vms.

dickersonka 104 Veteran Poster

you posted this in the mssql forum, are you using oracle then?

if so, post in there

dickersonka 104 Veteran Poster

i wouldn't suggest adding an additional column necessarily, but creating a view, that way, your duration will always be in sync with the columns

select USER_ID, START_TIME, END_TIME,
DATE_DIFF(second, START_TIME, END-TIME) AS DURATION_SEC
FROM
InternetAccess

depending on what you need, you can sub in minute, hour, or second amongst others for the datediff

dickersonka 104 Veteran Poster

Is the query taking that long to execute anyway?

I would suggest the bottom one, the less tables that are involved generally the more speed achieved, if performance is really that big of an issue with this query, then the cast will be slower but I don't think its that big of a deal here

dickersonka 104 Veteran Poster
System.Diagnostics.Process.Start("calc")
chitopolo commented: Thank You very much i was looking for this code like since 2 hours ago..! Thank u again! +0
dickersonka 104 Veteran Poster

i'm not quite sure what you are trying to do here, but there are 2 things

first you are referencing R3 outside of its scope, second you have a where instead of an and, here is my shot at what i think you are trying to do

select * from Results RT1 
where RT1.RDate = (select max(RT2.RDate) from Results RT2)
and RT1.RTime = 
 (select max(RT3.RTime) from Results RT3
   where RT3.RDate = (select max(RT4.RDate) from Results RT4))
Eager_Beever commented: Thanks for pointing out my mistake. +2
dickersonka 104 Veteran Poster

Ok, just wanted to make sure we aren't chasing a ghost

Rather than just adding the parameters with a name and value, try to add them with a name and type

SqlParameter param1 = new SqlParameter("@RDate", SqlDbType.DateTime);
param1.Value = dtCurrentDate;
sqlCmdCheckDuplicates.Parameters.Add(param1);

and do the same for the other one

dickersonka 104 Veteran Poster

this doesn't have error handling, but here is how you do it following your line

$result = $mysqli->query($queryStr);

$row_count = $result->num_rows;

$result->close();
dickersonka 104 Veteran Poster

For starters lets start off with syntax:

Did you see this line? SqlParameter("@ResultTime", ddRTime.Text.Trim())); your parameter is named @RTime

dickersonka 104 Veteran Poster

Are you sure you set the column's data type to datetime? It sounds like you are using varchar

dickersonka 104 Veteran Poster

Just to be sure and check all sides of the problem

I noticed:

this.txtStatus.Text + "\r\n" + text;

if its a one line textbox you won't be able to see the output, for testing purposes, try changing it to this

this.txtStatus.Text = text;

also be sure that in form shown you aren't setting the value of the textbox

dickersonka 104 Veteran Poster

are you trying to create viewstate?

if so, what front end language are you using?

dickersonka 104 Veteran Poster

This may not be of any assistance, but just in case. I have move pretty much all sql server's to virtual pc with no problem and think its a much better solution than having a separate dedicated machine a lot of cases. I'm assuming vmware is the same case, hope that possibly helps a little bit.

dickersonka 104 Veteran Poster

Ahhh sorry, forgot you only needed sql server

here's a link that should help
http://www.nigelrivett.net/SQLTsql/RemoveNonNumericCharacters.html

here it is with modification

CREATE FUNCTION dbo.AlphaOnly(@value varchar)
RETURNS VARCHAR
AS
BEGIN
DECLARE @returnVar varchar, @i int
SET @returnVar = @value

	select @i = patindex('%[^a-zA-Z]%', @returnVar )
	while @i > 0
	begin
		select  @returnVar  = replace(@returnVar, substring(@returnVar , @i, 1), '')
		select @i = patindex('%[^a-zA-Z]%', @returnVar)
	end

return @returnVar

END

you can use this udf in a trigger

dickersonka 104 Veteran Poster

here is my idea then

select translate('123AB45', 
         'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', 
         'ABCDEFGHIJKLMNOPQRSTUVWXYZ') from dual;

i don't necessarily know the context of how you need this, but this will replace all numeric values with '' and leave your string 123AB45 as AB

dickersonka 104 Veteran Poster

I mean that if you are typing for the control to receive the typed in text, then this event will get caught

dickersonka 104 Veteran Poster

This happens when the control has focus and the user presses a key

I use this here
if (Int32.TryParse(numString, out num))

to check if it was a numeric key that was pressed, if not, it is ignored

dickersonka 104 Veteran Poster

first add the event for PreviewKeyDown the same way as you did for validating

here is the code i would use inside the event
i'm not always that great at explaining things like this, and hopefully this will be more clear

//We get the key pressed
            KeysConverter kc = new KeysConverter();
            string numString = kc.ConvertToString(e.KeyCode);
            int num = -1;

            if (Int32.TryParse(numString, out num))
            {
                //Get the current value 
                string curVal = this.numericUpDown1.Value.ToString();
                //Set our new value
                curVal += num.ToString();

                //Now we check the new val against our control
                if (Int32.TryParse(curVal, out num))
                {
                    if (num > this.numericUpDown1.Maximum || num < this.numericUpDown1.Minimum)
                    {
                        MessageBox.Show(curVal + " is out of the range");
                    }
                }
            }
dickersonka 104 Veteran Poster

of course, the same as you would any other property

public int[] LendMoney
{
get{return lendMoney;}
set{lendMoney = value;}
}

Might want to use an arraylist instead, if its not a fixed length

dickersonka 104 Veteran Poster

no, i don't believe the replace has that exact logic

show us your complete update statement or select whatever that may be, and lets go from there

dickersonka 104 Veteran Poster

would adding a trigger that will format the field to only be characters upon inserts and updates be sufficient?

dickersonka 104 Veteran Poster

well lets start with this

what is the connection string?

dickersonka 104 Veteran Poster

add a where clause for
where str = 'jon' or str like ('jon %')

notice the space after jon

dickersonka 104 Veteran Poster

Yeh that didn't quite work as i thought it would have

What you can do instead is capture previewkeydown
add this to the existing field

"12" + "4"

124

then check 124 to be greater than the max

dickersonka 104 Veteran Poster

In the designer click on the events for the numeric control you are trying to catch the events for and double click on validating

Or on the codeside
numericcontrol.Validating += eventnamehere

dickersonka 104 Veteran Poster

Oh i thought you were making your own control

You should be able to catch the validating event and get the value before it has changed back to maximum

dickersonka 104 Veteran Poster

from the ui we get a filepath

string filePath = this.textBoxPath.value;

//We call our class like this from the ui
BusinessLogic logic = new BusinessLogic(filePath);
logic.Load();

we'll pass it into the business logic through a constructor

public class BusinessLogic
{
private string filePath;
  public BusinessLogic(string filePath)
{
this.filePath = filePath;
}

public void Load()
{
//now we use the filepath to load the xml file
}
}