|
in tA.CreateDate column you can make '07/25/2007'..i think this'7/25/2007'time format wrong...plz try this
|
|
|
|
|
Data stored in CreatedDate colum is DateTime i.e. the column has both date and Time.
but while retrieving you are using only Date. so Automatically system takes time as "00:00:00"
change you condition to ...
ta.CreateDate BETWEEN '25-Jul-2007' AND '26-Jul-2007'
Regards
KP
|
|
|
|
|
This is because of format of date is different in your table column field(i.e. CreateDate and you are comparing this date with another format which is mm/dd/yyyy. If you want to do it then you have to convert your format and you will sure get result. Now use this query to get the result.
select tU.UserID,tU.FirstName,tU.LastName,<br />
tU.LastName+''+ tU.FirstName'UserId',<br />
tA.UserID,tA.CreateDate,<br />
tA.UpdateDate<br />
from tAnalyst tA,<br />
tUser tU<br />
where tU.UserID=tA.UserID<br />
and<br />
convert(varchar,tA.CreateDate,101)='07/25/2007'
|
|
|
|
|
Thanku very much sir
your query is running.
thanku
gayatri
Gayatri
|
|
|
|
|
hi
whenever you are dealing with dates..convert the dates to a common format...
you can use convert function for this.
regards
Joe
|
|
|
|
|
Hi,
I have one column with numeric data type.
It is auto number.
i have given size numeric(9,0)
now i want to pad 0.
eg. if it is 1 in auto number then i want to display
000000001
if 2 then 000000002
if 10 then 000000010
kiran banker
|
|
|
|
|
check is this what you are looking for
<br />
SELECT <br />
CASE WHEN Len('00000000' + LTrim(str(myid))) > 9 THEN <br />
SubString(<br />
'00000000' + LTrim(Str(myid)), <br />
Len('00000000' + LTrim(Str(myid))) - 9, <br />
Len('00000000' + LTrim(Str(myid)))<br />
) END<br />
FROM tableA<br />
Regards
KP
|
|
|
|
|
Hi Kiran,
The code below will insert '15' into ten zeroes and keep it right justified.
You will just need to jiggle things a bit substituting your number for '15'
<br />
select stuff('0000000000',11-len('15'),len('15'),'15')<br />
Or even better
<br />
select stuff(replicate('0',10),11-len(cast(15 as varchar(100))),len(cast(15 as varchar(100))),cast(15 as varchar(100)))<br />
I hope this is of help.
Guy
You always pass failure on the way to success.
|
|
|
|
|
I think this is easier:
SELECT RIGHT('00000000' + Ltrim(str(MyKey)), 8)
From Table
Ian
|
|
|
|
|
hi
i'm looking for an article that explain replication good, can u give me a link for that article ?
thanks
|
|
|
|
|
please give me asp.net sample program with ado.net
send through mail
amsathu
|
|
|
|
|
... Why don't you search google??
Visit my blog at http://dotnetforeveryone.blogspot.com
|
|
|
|
|
|
How about doing a search here on CP? There are plenty of examples
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Can anyone tell me how to retrieve the column names in a table?
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
If you are using sql server then you can use the following query:
SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'name_of_the_table'
|
|
|
|
|
ist working? i tried this query but its saying Invalid columnname...
Rajendran
|
|
|
|
|
Yes, it is. Just make sure you are performing the query against the database that contains your table
|
|
|
|
|
Thanks a lot. It is working fine.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
You are welcome
|
|
|
|
|
hi
try this qry
select name from syscolumns where id=
(select id from sysobjects where name=)
|
|
|
|
|
In SQL,
Assume columnname- id(It should be identity and autoincrement),Name
then you will try this query
select name from tablename where id=0
Rajendran
|
|
|
|
|
In MS SQL Server syscolumns table holds column names and sysobjects table names.
SELECT * <br />
FROM syscolumns co<br />
INNER JOIN sysobjects so ON co.id = so.id<br />
WHERE so.name = 'mytable'
Regards
KP
|
|
|
|
|
Hi Jaya,
For a simple solution try this
sp_help ''
Senthil
|
|
|
|
|