|
Hi,
how (if at all) is it possible to do something like this...
I want to select a column value from the database but i want to make sure that what i select, has a fixed length with spaces in the front of it if it is to short... example.
....Test1<br />
.....Test<br />
.LongTest
Each "." represents a space.
(so the select statement should be something like: SELECT (BlankSpace for x amount... where x amount would be (in my example: 9) - Len(TestColumnValue) + TestColumnValue) ) This will ensure that the selected values are right aligned and all the same length...
Is this possible and how if it is? I hope i explained what i need clearly... please let me know if you need more info.
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
hi
try this
select right(space(20) + rtrim(FIELDNAME), 20)
from TABLENAME
Regards
Joe
|
|
|
|
|
thank you... this looks promissing.
I am playing around with this now.
thank you for your time
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
I believe this was already dealt over here[^]
Once you have mastered the ability to turn yourself invisible at will, and to deflect bullets with your hair, you will be ready to come back here to the lounge and post programming questions.Only at this point will you be able to dodge the fireballs that are going to come your way. - Pete O'Hanlon
|
|
|
|
|
i though i had it figured out too...
But now with the space() function... i can get the result i am looking for without using variables.
Thank you for your time
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Sorry....
But what does the right( do (i used select right(space(20) + 'TEST', 25) ? i tested the also with select left(space(20) + 'TEST', 25) ... i did not notice a difference.
What does the left or right do in this section?
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
select replicate('.', 9 - len(ltrim(rtrim(TestColumnValue)))) + ltrim(rtrim(TestColumnValue))
from YourTable
and this will left prefix with '.' character your field.
Nuclear launch detected
|
|
|
|
|
HI friends..
i want to display row wise values in the oracle table..TO THE columnwise of the DB GRID IN DELPHI..(ROWWISE VALUES TO COLUMNWISE... FROM ORACLE TABLE TO DBGRID IN DELPHI)
THANKS
MAHEN
|
|
|
|
|
This site deals with Microsoft technologies. You would be better off asking your question on a Delphi site.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi ,
i have got a datagridview object in my form..When i click a cell i wanna know if dg.currentrow[5].cell.value == null or not . . . . . .
thanx ...
|
|
|
|
|
tr_thorn wrote: When i click a cell i wanna know if dg.currentrow[5].cell.value == null or not
Try Convert.IsDBNull(dg.currentrow[5].cell.value) .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
|
Did you try to find the answer yourself before posting?
It took me 3 seconds to find this[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Yes, I even try to figure out the reason, I'm puzzled still.
Why can't be -> sp.StateProvinceID = p.StateProvinceID, instead of p.StateProvinceID = p.StateProvinceID ?
NEWBIES - Aaron
|
|
|
|
|
DotNet wrote: Why can't be -> sp.StateProvinceID = p.StateProvinceID, instead of p.StateProvinceID = p.StateProvinceID ?
It's a typo. It should be
sp.StateProvinceID = p.StateProvinceID
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks a lot, Paul...
NEWBIES
|
|
|
|
|
hi , how can I Enable/Disable Remote Connection by Script?
thanks in advance
|
|
|
|
|
select answer from forums where forum_name like '%remote%'
This is the forum for SQL/ADO/ADO.NET. Your remote connection question have little chances to get an answer here...
Nuclear launch detected
|
|
|
|
|
Hi,
Anyone knows how to use login control and how to connect it with the SQl server 2005 and connect to the table within my application database. So it can match the values from the table I have already created in my database.
Rock Star
|
|
|
|
|
|
I shall ignore
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
select (5/7) always result 0 .... how can i correct this result ?
plz help
|
|
|
|
|
SQL-Server assumed that you wanted an integer result because both of the operands were integers.
Try: select convert(float, 5) / 7
Regards
Andy
|
|
|
|
|
hi there,
i have 2 table, first have 2 columns(ID, Name) here ID is primary key
second have 9 columns (ID, 1, 2, 3, ... 8) here ID is primary key too
in second table column names from 1 to 8 have ID Numbers from Table First(which is primary)
and i want to make them foreign keys (from 1 to 8) so that if i delete ID from first table then the action that is set to "Set Null" will set that cell to null
for example
first table have data like this
[ID] [Name]
15 ABC
16 ERT
17 GHJ
18 LKI
in second table :
[ID]_[1]__[2]__[3]__[4]__[5]__[6]__[7]__[8]
14___16___18___17___15___17___17___15___15
15___18___18___17___16___18___18___17___15
16___15___18___16___15___17___17___16___15
now what i want, if i delete ID 16 from first table then the value 16 in table second shoul be set to "null" (from 1 to 8) so it will look like this:
[ID]_[1]__[2]__[3]__[4]__[5]__[6]__[7]__[8]
14________18___17___15___17___17___15___15
15___18___18___17________18___18___17___15
16___15___18________15___17___17________15
to do that i make 8 relationships, and set all actions as
update = cascade
delete = set null
but when i save it, it give error
'firsttable' table saved successfully
'secondtable' table
- Unable to create relationship 'FK_secondtable_II_firsttable'.
Introducing FOREIGN KEY constraint 'FK_secondtable_II_firsttable' on
table 'secondtable' may cause cycles or multiple cascade paths.
Specify ON DELETE NO ACTION or ON UPDATE NO ACTION,
or modify other FOREIGN KEY constraints.
Could not create constraint. See previous errors.
i want both actions, but sql is not allowing me to do that
it can be done by this, but i dont want to use this method
update secondtable set [1] = NULL where [1] =
update secondtable set [2] = NULL where [2] =
update secondtable set [3] = NULL where [3] =
update secondtable set [4] = NULL where [4] =
update secondtable set [5] = NULL where [5] =
update secondtable set [6] = NULL where [6] =
update secondtable set [7] = NULL where [7] =
update secondtable set [8] = NULL where [8] =
some have any solution?
thanks
-- modified at 7:26 Thursday 22nd November, 2007
Becoming Programmer...
|
|
|
|
|
Hi,
I am having a problem.Actually what i want is to find the Dates between particluar Dates like how many dates between two dates.For this i dont have any table.Then after i want to store this resultset in the Temporary Table.
i have done lots of RNd but didn't get the ans.
Thanks in Advance
Avesh
|
|
|
|