|
It's my pleasure to help you.
|
|
|
|
|
Thank you,
That did the trick...
"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
i want to fetch records from table where values in the column can be
(((joan AND smith) OR (sally AND rogers) OR ((pete OR peter) AND miller)) AND ((barbeque OR bbq OR bb-q) OR sauce OR chicken OR chikn OR flavor))
|
|
|
|
|
firstly what DB are you using MySql Oracle Access or MS SQL
|
|
|
|
|
|
I think this will help.
SELECT Col1, ColToSearch
FROM table
WHERE CONTAINS (ColToSearch, '"quick easy" or "Help"')
you must have full text index setup on the table field you are searching
|
|
|
|
|
Hi, Is there anyway to have SQL Server 2000 run a function on a database if a specific table is updated or a row added?
my problem is this I am having to work with two seperate databses for 2 sepreate programs, I need data from the first program in my second program,
but if anybody adds a new row or record to my table in database 1, I want to update the table in my second database using an sql server auto function, and the server must run a change on db2 if the table in db 1 is changed.
I hope this made sense, the main reason for doing this I do not have access to the source code for the first program so this must happen on the DB side.
|
|
|
|
|
i dont know exactly but i think it can be done with the help of Triggers
|
|
|
|
|
thanks man, I been searching the whole day for SQL watch, not trigger lol thanks man.
|
|
|
|
|
I have written a C# dll which makes a call to some unmanaged code.
When i tried to register this dll on SQL server 2005 i got the following error.
Msg 6215, Level 16, State 1, Line 1
CREATE ASSEMBLY failed because method 'AddNumbers' on type 'Project1._Class1' in safe assembly 'Interop.Project1' has invalid attribute 0x1003.
How do i register such a dll.
|
|
|
|
|
|
Good Morning All
i have the Following Cursor that Displays data , like this
<br />
SET NOCOUNT ON<br />
Declare @Property_ID int ,<br />
@Lis_key Varchar(12),<br />
@Effective_DAte Datetime,<br />
@Func_key Varchar(12),<br />
@Property_ID2 int ,<br />
@Lis_key2 Varchar(12),<br />
@Effective_DAte2 Datetime,<br />
@Func_key2 Varchar(12)<br />
<br />
Declare Find_Val Cursor for <br />
select p.Property_ID, p.Lis_key,v.Effective_Date,<br />
p.Func_key from Valuation v<br />
Inner Join Property p <br />
on p.Property_ID = v.Property_ID<br />
where V.Effective_date ='2002/07/01'<br />
And v.Val_Status_ID = 2<br />
And v.Archive_Date is NUll<br />
And p.Archive_Date is Null<br />
<br />
Open Cursor Find_Val<br />
<br />
FETCH NEXT FROM Find_Val INTO<br />
@Property_ID,<br />
@Lis_key,<br />
@Effective_DAte,<br />
@Func_key<br />
WHILE @@FETCH_STATUS = 0<br />
BEGIN<br />
SELECT @Property_ID,@Lis_key , @Effective_Date , @Func_key<br />
<br />
--Declare<br />
DECLARE Second_cursor CURSOR FOR <br />
select V.Property_ID, P.Lis_key,v.Effective_Date,<br />
p.Func_key from Valuation v, Property p<br />
where v.Property_ID = @Property_ID<br />
And EFFECTIVE_DATE = '2008/07/01'<br />
<br />
OPEN Second_cursor<br />
<br />
FETCH NEXT FROM Second_cursor INTO<br />
<br />
@Property_ID2,<br />
<br />
@Lis_key2,<br />
<br />
@Effective_DAte2,<br />
<br />
@Func_key2<br />
<br />
IF @@FETCH_STATUS <> 0 <br />
<br />
WHILE @@FETCH_STATUS = 0<br />
<br />
BEGIN<br />
<br />
SELECT @Property_ID2,<br />
<br />
@Lis_key2,<br />
<br />
@Effective_DAte2,<br />
<br />
@Func_key2<br />
<br />
<br />
FETCH NEXT FROM product_cursor INTO <br />
<br />
@Property_ID2,<br />
<br />
@Lis_key2,<br />
<br />
@Effective_DAte2,<br />
<br />
@Func_key2<br />
<br />
END<br />
<br />
CLOSE Second_cursor<br />
<br />
DEALLOCATE Second_cursor<br />
<br />
FETCH NEXT FROM Find_Val into<br />
@Property_ID,<br />
<br />
@Lis_key,<br />
<br />
@Effective_DAte,<br />
<br />
@Func_key<br />
<br />
End <br />
<br />
CLOSE Find_Val<br />
<br />
DEALLOCATE Find_Val<br />
And when i run this Cursor i get the Following Error
Msg 156, Level 15, State 1, Line 21
Incorrect syntax near the keyword 'Cursor'.
And this Points to this line
Open Cursor Find_Val
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Vuyiswa wrote: And this Points to this line
Open Cursor Find_Val
The CURSOR keyword isn't required here, only OPEN <cursorname> .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks man it worked
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
|
Try using DateDiff function
DATEDIFF(day, pubdate, getdate())
|
|
|
|
|
like this
select datediff(d,'2007-08-08',getdate())
2007-08-08 is old date getdate is new date
I love li li huang ,
ha ha ,
but you don't who is she!
|
|
|
|
|
Don't delete your question - It is rude!
|
|
|
|
|
Geeze, one of those
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
I have an employee table with employee data like empid, empname, empcreateddate. Every data new employees will join, so data is inserted in this table. I want to need reports weekly, to know, In this weak how many new employees are joined?
How to do? can u give query for this?
I am not getting the result, when i am using this below query
Select * from Employees
where EmpCreatedDate between convert(varchar,getdate(),101) and convert(varchar,getdate()-7,101)
G. Satish
|
|
|
|
|
See date functions from msdn here[^]
DateAdd, DatePart and GetDate will be there to help you.
Regards,
Mehroz
|
|
|
|
|
Try the following query
Select * from Employees
where EmpCreatedDate between select DATEADD(DAY, -(DATEPART(dw,GETDATE())-1),GETDATE()) and getdate()
|
|
|
|
|
Select * from YourTable where datediff( day, YourColumn, Getdate()) < 8
Do good and have good.
|
|
|
|
|
Hi i have one doubt...,
I want to add a month from the given date...,
Mean suppose if i give a date(mm/dd/yyy)='01/01/2008' from that add 30 days and give '31/01/2008'
another example if i give '02/16/2008' add 30 days and give '03/16/2008'
like this,
how its possible?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
You can use the DateAdd function. See msdn documentation
here[^]
Regard,
Mehroz
|
|
|
|
|