Doh!,
I really was asleep this morning, couldn't think SQL, now with brain fully functioning, i have easily done this Query myself using the BETWEEN function!
-Richard
I am having a problem with a query, and because it is Monday morning i don't think my Brain is quite working properly yet, so maybe some one can help me out ?
I have a table in which i have 2 Columns (see below)
Start No / End No
__________________
1! 200 ! 300
2! 400 ! 500
3! 600...
Thanks PH, but for some reason this didn't seem to work quite right.
And finally today, the Informix DBA guy at my work had some time free & and has written me a stored procedure using Informix 4GL that does the job spot on !
Thanks Anyway, i think i learned something from this !
Thanks for replying so quick PH, but how can i get the WHERE clause to bring back the 50 OLDEST records with out doing an Order by ?????
WHERE req_Created = ????
If you could tell me that it would solve my problem !!!!
Cheers
Richard
Thanks for that Nigel, but that wont work in Informix, as firstly 'top' is not a key word, you need to use 'first' and temp tables work differently !
Anybody know how i can get this to work with an Informix database ?????
Or does anybody know of a good informix forum where i could ask this...
I have a query where i need to Update the Top 50 records of a resultset. The way i figured to do this was, Select the Top 50 of the records i want into a temporary table, and then update from the table.
The problem with this is that i need to Order the 50 by Date, so i am getting the 50 oldest...
Hi SQLBill,
I knew that the where clause was wrong, i had been hoping that i could use Is Numeric the same as is null
Which works fine in the WHERE clause like:
SELECT LinkRef FROM Derivedaddresses
WHERE LinkRef is null
Obviously i can't, but i thought my examples would show what i was...
I feel that i should know how to do this but the ways i have tried don't work;
SELECT linkref
FROM Derivedaddresses
WHERE right(linkref,1) IS NUMERIC
SELECT linkref
FROM Derivedaddresses
WHERE ISNUMERIC(right(linkref,1))
linkref is a varchar field, and has both Alpha ~& numeric...
Hi, I have an Address Field in a table, that is a bit of a mess, and I am trying to clean it up.
The first step I would like to do is to remove all the Double spaces for the records in this column, and by this I mean, reducing any double space to a single space!
Joe Bloggs --> would become...
FattyFatPants,
i think your problem is to do with your table fields !
Am i right when i think you are saying the Values of cost.cbiper & periodt.pe would be in a format of
e.g. - '06030404' If this is the case then they will be giving you the conversion error !!!
I believe that when you run a DTS from a SQL Statement or by Executing it manually you will be running it LOCALLY, where as SQL Server JOBS run on the SERVER machine.
It may just be a case of permissions !!!
Have you tried Converting the Date Values you want to use into smallDateTime, outside of the SELECT statement, so you can see if that is the problem.
Example:
If the Char Dates wont Convert using
DECLARE @TestDateConversion as smalldatetime
set TestDateConversion = cast(@EndBillPer as...
Oh i forgot to add, the syntax for using a linked server after you have created it is
[LinkedServerName].[DBName].[TableName].[fieldname]
You may want to alias in the WHERE statement as SQL server doesn't like you using 3 dots like above in a statement.
So,
SELECT *
FROM...
ArtieChoke is correct, if you go to the Security tab in SQL Server Engine, and expand it, you should see an option called LINKED SERVERS!
By bringing up the right click menu (on the Right Pane) you can select Create New Linked Server, here you need to give details about the Server you want to...
In your examples, thier is no difference, both will run exactly the same.
Where Variables come in very useful in the above context is in Stored Procedures.
If you want @find to be dynamic, then create it as a parameter for a stored procedure, then each time you run the Stored Proc, you can...
Have tried your suggestion HROARKE, but it seems that thier is something different about 1 server we are using from the others.
You see i have even gone as far as detaching the database and re-attaching it on two different servers now!, and yet my query runs in 1 second on one server and 6...
What does Oracle's ntile function do ?
if you post this, you may get more help, as i for one have no idea what it does, and therefore can't tell you what it's SQL Server equivalent is !
It can be done, but your syntax is wrong.
Sorry don't have the time to give example now, but basically you cannot put your 'LEFT JOIN ... ON' command next to the update statement, it must come after the WHERE statement !
Is almost the same as for an access database.
Go to your Datasources[ODBC] in Admin Tools in Control Panel. Select Add to add a dsn, then Where it asks you for a driver, go to the very bottom of the list and select SQL SERVER.
The rest is easy, just follow the Wizard, giving a name for your...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.