Date Issue In A SQL 2005 Scheduled Job
Feb 26, 2007
I have a job in SQL 2005 that when it runs works fine if I hard code the Makedate, what I need it to do is have the Makedate equal todays date minus one day...I came up with the code below, but that does seem to work...any thoughts.
INSERT INTO abcTransaction
(
Payee,
Payment,
AccountNumber
)
SELECT
'Credit',
SUM(Rebate * Quantity),
A.AccountNumber
FROM
Account A
INNER JOIN
abdTrades T on A.AccountNumber = T.AccountNumber
Where MakeDate = getDate() - 1
GROUP BY
A.AccountNumber
View 5 Replies
ADVERTISEMENT
Aug 30, 2001
A user has created a scheduled job with the following command:
insert into tblHoursWorked ([DATE], STORE_ID, EMP_ID, HOURS, START_TIME, END_TIME)
values ('01-jan-2000', '4321', '9999999999', 5, '09:00', '14:00')
This can be run correctly from Query Analyser, but the job itself fails with the following error: Incorrect syntax near '20010830'. [SQLSTATE 42000] (Error 170). The step failed.
How do I get this to run as a sheduled task?? All the users and the server itself run under US English if it is relevant.
Thanks
Derek
View 2 Replies
View Related
Dec 11, 2006
We have a product that uses SQL Express that is ready and waiting to go to market. It absolutely requires Vista compatibility on day one. When will SP2 be released? The UAC problem has been known for months.
We cannot distribute the November CTP, of course. Manually correcting SQL Express installs on Vista using the recommended workaround is impractical to say the least.
View 1 Replies
View Related
Nov 12, 2004
Hi there,
SQL newbie here, and thanks for any help you may able to provide.
My intention is to schedule/execute a stored procedure every morning at 12:00 a.m. that deletes all records with a column value of the day before. I.E., one of my Table columns is named POSTDAY, and could have values such as Sunday, Monday, Tuesday, etc, and on Tuesday morning, I'd like to DELETE all records with a POSTDAY value of Monday.
I think I can do this by creating and scheduling 7 different stored procedures (each with the actual DayName), but was wondering if it's possible to just have 1 accomplish the same thing, and without having to pass any parameters to it.
Thanks again.
View 4 Replies
View Related
Feb 15, 2008
Hi, I need to write a script to run an automation in MS SQL 2005. It will run every 10 hours. What the script will do is just import a .cvs file into a database table. Can someone let me know how can I acheive this? Thanks in advanced.
View 2 Replies
View Related
Feb 9, 2007
Setting: sql 2005, SP1.
I created a new job (under SQL Server agent) which runs a simple ActiveX script. When run interactively, the job runs fine. But when run under the scheduler the job fails to even start. There is no error message and "History" makes no reference at all to the job run. I checked, the job is enabled. Any thoughts much appreciated.
TIA,
barkingdog
View 1 Replies
View Related
Jul 25, 2006
We just installed SQL Server 2005. I have 3 jobs within SQL Server 2000 that i would like to import into the new server howeber i have no clue on how to achieve this. In fact I dont even know how to make a new job within SQL Server 2005 at all? Can someone please give me the steps on how to do this.
BTW the old job accesses launches a .EXE application every day, once a day at 5pm and the other job launches the same applicationb but at 5am. I had to have 2 seperate jobs because I couldnt figure out how to pass a different parameter for the two launches.
Thanks.
View 3 Replies
View Related
Jan 2, 2008
Hi All
I designed a maintenance plan in 2005 it create job in SQL Server Agent-->Jobs when i right click on job to check the properties it doesn’t give me the details of that job instead it open the window for new job which is not the case in 2000. Can some one there please let me know how to check the job details in 2005in GUI not in terms of T-SQL
Regards
View 19 Replies
View Related
Nov 8, 2007
Hi Guys,
Any assistance you people can provide will be considered grateful. I€™m in search of a generic cookie cutter snippet of code that simulates the creation of an Oracle DBMS_JOB, but I need it for SQL Server 2005.
Beneath, highlighted in red, is how we create a DBMS_JOB in Oracle, but I need the snippet of code to accomplish the same objective on SQL Server 2005. In Oracle, we deploy our scheduled jobs using anonymous pl/sql which is written in black, as shown beneath. To facilitate conversion of our project scheduled task it would be great if someone can assist me in translating the code beneath written in black and red.
REM spool schedule-jobs_a.sql.log
REM declare
REM jobno NUMBER;
REM cursor job_cur is select job from user_jobs
REM where what like 'dbms_utility.analyze_schema%';
REM begin
REM
REM for job_rec in job_cur loop
REM dbms_job.remove(job_rec.job);
REM
REM end loop;
REM dbms_job.submit(jobno,what => 'dbms_utility.analyze_schema(''&&anal'',''compute'');', interval => 'TO_DATE(SUBSTR(TO_CHAR(TRUNC(SYSDATE+1)),1,10)) + 360/1440', next_date => SYSDATE);
REM dbms_output.put_line( 'Next job '||jobno );
REM exception
REM when others then raise;
REM end;
REM /
PS, I€™m not looking for instructions to create a Scheduled Job through Microsoft SQL Server Management Studio, but rather, I need T-SQL code to create a Schedule Job to run daily at some period of time and run some snippet of code.
Thanks,
Vikram
View 3 Replies
View Related
May 27, 2007
I have a strange problem that I think deals with security on SQL 2005.I have a scheduled task that runs on a Windows 2000 machine. It callsa vb script which creates a connection to SQL Server.We migrated a database from SQL 2000 to 2005 which is on a differentbox. I changed the connection in the vb script to use the new sqlserver. The original connection to SQL 2000 used the 'sa' accountcoded into the connection string , which we don't want to use on thenew server, so I changed the connection string in the script to usethe below login information.Const strConnection = "Provider=SQLOLEDB;DataSource=SQLServer;Integrated Security=SSPI;Persist SecurityInfo=False;Initial Catalog=database;I created a domain user and gave it dbo rights on the new database onSQL 2005 as well as administrative rights on the local machine and thenetwork. The task runs fine for a while and then it will fail tostart. I have looked in the event log as well as the SQL log and havenot found anything else that ran when my task failed. Once it hasfailed, if I manually run the vb script on the 2000 machine, it runsjust fine, but the schedule won't work. If I change the name of theuser that is running the scheduled task, it will begin working again.I have run the profiler on SQL 2005 and watched the scheduled tasklogin as the correct user and update the database. There is nopattern to when the scheduled task will stop running. This has beenhappening for a few days now.This script and scheduled task worked fine for over a year on themachine when it logged into SQL 2000 and nothing else has changed,which makes me think it is related to the SQL 2005 server. Any ideas?
View 1 Replies
View Related
Feb 13, 2008
Below is a migration plan that I've compiled to migrate SQL 2000 DTS packages to SSIS 2005. Once these DTS packages have been migrated i will need to create a job and schedule them in SQL 2005.
I would appreciate and feedback or questions on this migration plan.
Migration DTS 2000 packages to SSIS 2005:
1. Will need to save the current production DTS package as structure storage file. We do not have a UDL file. We set the data connections within each DTS package.
2. Go to Sql 2005 - ManagementLegacyData Transformation Services - right-click and open previous saved structure storage file.
3. Modify the DTS data creditentials to reflect the SQL 2005 connection data. Modify any SQL 2000 MAPI settings to utilize SQL 2005 new database mail. Save the package on SQL 2005.
4. After the modified DTS package has been updated and saved on SQL 2005, save this file as a structure storage file.
5. go to BIDS. Create a new SSIS project. Right-click on SSIS packages and select Migrate DTS 2000 package. This will migrate over the DTS 2000 package with the updated SQL 2005 data creditentails.
6. click on the package properties - protectionlevel and change it to dontsavesensitive.
7. right-click and select package configurations..., select to store data creditentials in xml format.
8. right-click on execute DTS 2000 package task, select Edit... and click on Load DTS2000 package internally. This will embed this task into the new SSIS package. Test the package. Continue if successful.
9. Use SSIS deployment functionality to move the package over to SQL 2005 Integration Services. Right-click on package and select Run Package, if successful, create a job and schedule it to run on SQL 2005 Agent.
10. When creating the Job under SQL Agent, change the Owner: of the job to reflect the owner of the new SSIS package. Schedule the job.
I've just coming up to speed on SSIS 2005. Therefore, this is what i've been able to piece together up to this point and I'm looking for some industry advice/feedback on whether or not this is a good migration plan. I need to provide a migration plan to management by 2/18. Thanks
View 1 Replies
View Related
Jul 15, 2007
Hi allI am looking for the best method to automate a website's database management. Lets say I have a user registration database and the users register. This sends an automated email to the user with a link to activate the users registration. If the user does not register within 24 hours, his registration must be automatically deleted from the database using a stored procedure.I know how to do this using the global.aspx file, however there must be an alternative way of doing this, especially if the database is an SQL database. I do not know how much MSSQL server access is given to a developer by an as ISP who hosts the website.Can anyone tell me what would be the best method to use.ThxWarren
View 1 Replies
View Related
May 4, 2007
Hi,
I have soma ado.net code that inserts 7 parameters in a database ( a date, 6 integers).
I also use a self incrementing ID but the date is set as primary key because for each series of 6 numbers of a certain date there may only be 1 entry. Moreover only 1 entry of 6 integers is possible for 2 days of the week, (tue and fr).
I manage to insert a row of data in the database, where the date is set as smalldatetime and displays as follows: 1/05/2007 0:00:00 in the table.
I want to retrieve the series of numbers for a certain date that has been entered (without taking in account the hours and seconds).
A where clause seems to be needed but I don’t know the syntax or don’t find the right function
I use the following code to insert the row :
command.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime, 40, "LDate"));
command.Parameters[6].Value = DateTime.Today.ToString();
command.ExecuteNonQuery();
and the following code to get the row back (to put in arraylist):
“SELECT C1, C2, C3, C4, C5, C6 FROM Series WHERE (LDate = Today())�
WHERE LDate = '" + DateTime.Today.ToString() + "'"
Which is the correct syntax? Is there a better way to insert and select based on the date?
I don’t get any error messages and the code executes fine but I only get an empty datatable in my dataset (the table isn’t looped for rows I noticed while debugging).
Today’s date is in the database but isn’t found by my tsql code I think.
Any help would be greatly appreciated!
Grtz
Pascal
View 5 Replies
View Related
Mar 3, 2008
Does anyone know if/when SQL 2005 SP3 will be released? Thanks.
View 1 Replies
View Related
Sep 21, 2006
HiI am using SQL 2005, VB 2005I am trying to insert a record using parameters using the following code as per MotLey suggestion and it works finestring insertSQL; insertSQL = "INSERT INTO Issue(ProjectID, TypeofEntryID, PriorityID ,Title, Area) VALUES (@ProjectID, @TypeofEntryID, @PriorityID ,@Title, @Area)"; cmdInsert SqlCommand; cmdInsert=new SqlCommand(insertSQL,conn); cmdInsert.Parameters.Add("@ProjectID",SqlDbType.Varchar).Value=ProjectID.Text; My query is how to detail with dates my previous code wasinsertSQL += "convert(datetime,'" + DateTime.Now.ToString("dd/MM/yy") + "',3), '";I tried the code below but the record doesn't save?string date = DateTime.Now.ToString("dd/MM/yy"); insertSQL = "INSERT INTO WorkFlow(IssueID, TaskID, TaskDone, Date ,StaffID) VALUES (@IDIssue, @IDTask, @TaskDone, convert(DateTime,@Date,3),@IDStaff)"; cmdInsert.Parameters.Add("IDIssue", SqlDbType.Int).Value = IDIssue.ToString();cmdInsert.Parameters.Add("IDTask",SqlDbType.Int).Value = IDTask.Text;cmdInsert.Parameters.Add("TaskDone",SqlDbType.VarChar).Value = TaskDoneTxtbox.Text;cmdInsert.Parameters.Add("Date",SqlDbType.DateTime).Value = date;cmdInsert.Parameters.Add("IDStaff",SqlDbType.Int).Value = IDStaff.Text;Could someone point to me in the right direction?Thanks in advance
View 3 Replies
View Related
Dec 3, 2007
hi all,
in my sql server 2005 , i 've a table gg containing a column 'date'.its data type is datetime ,null
now i want to insert only the date to this field from vb.net page. i dont want "time" to insert in this page. one more thing ,i know varchar will work for what i need but i want to use date time. If anyone who knows how this is possible pls do send me the code.
thanks swapna
View 10 Replies
View Related
Jan 11, 2008
hi,
i have problem while searching date in datebase using like operator ,i write the below query but this will not give any result and i have the date 13/1/2008 in my table meeting please any one help me.
select meetingdate from meeting where meetingdate like '%13/1/2008%'
thanks
prasath
View 4 Replies
View Related
Feb 22, 2006
Hello all,
Many people are angry at MS for promising and not delivering on the mirroring feature of SQL 2005.
Does anyone have any idea - officially or unofficially when this feature will be available for reliable use, as we would like to use it.
Thanks,
S.
View 2 Replies
View Related
Apr 25, 2008
Hello Everyone, thank you for taking the time to read my post. I'm creating a view in SQL Server 2005 to base a report on Crystal Reports XI. I've been trying to figure out how I can convert a date field in the format YYYYMMDD to MM/DD/YYYY. I'm not quite sure about the steps I need to take to accomplish this since I'm pretty new to this. The date is stored as an Int on the database, and I've tried converting it directly to the DATETIME data type like this: CONVERT(DATETIME, datefield,101) but I'm getting an error saying illegal data type conversion. Thanks a lot for your help, I really appreciate it.
MS
View 7 Replies
View Related
Sep 26, 2007
Hi all,
does anybody know when SQL Server 2005 Service Pack 3 will be released?
We are currently encountering a lot of problems with replication. We have seen that the different SP2 Cumulative Updates are fixing a lot of replication troubles... but as they are not fully tested, we do not want to install them on our production servers.
Thanks in advance!
View 4 Replies
View Related
Apr 19, 2006
For some reason, I recall having read that SQL Server 2005 would supporta datatype that represented date, but not time. (This would be usefulfor storing things like birthday, where you usually don't care about thetime of day). But I've got SQL Server 2005 installed, and there's nosuch datatype to be found.Is this something that might be released in a Service Pack, or is itjust not going to happen?
View 3 Replies
View Related
Sep 25, 2007
Hi all,
does anybody know when SQL Server 2005 Service Pack 3 will be released?
We are currently encountering a lot of problems with replication. We have seen that the different SP2 Cumulative Updates are fixing a lot of replication troubles... but as they are not fully tested, we do not want to install them on our production servers.
Thanks in advance!
View 6 Replies
View Related
Oct 28, 2007
Hi all ,
What is the best solution for reading/writing Persian Date from/into SQL Server 2005 and do calculations on it?Note That I connect to sql server database from a .Net App.
Any help would be appreciated .
Thanks in advance.
View 12 Replies
View Related
Feb 5, 2008
I wrote a function and a SQL to get the 3 columns Date,Total Orders
& Amount, for dates between Date Started and Date Completed if I
pass different Dates in the SQL I get the correct result but if I pass
same dates then I don't get the result I am looking for .For Instance,if I give Date From=1/02/2008 ;Date To=1/8/2008(Different dates )I am getting values for all the three columns.But I give same dates for Date From=01/02/2008 ;Date To=01/02/2008 then I am not getting the records.Some how I could not trace what could be the error in my SQL /Function.I appreciate if I could get some work around for this.Thanks! Function:create function dbo.CreateDateList(@start datetime, @end datetime)returns @t table ( [date] datetime )asbegin if @start is null or @end is null return if @start > @end return set @start = convert(datetime, convert(varchar(10), @start, 120), 120) set @end = convert(datetime, convert(varchar(10), @end, 120), 120) while @start < @end begin insert into @t ( [date] ) values (@start) set @start = dateadd(day, 1, @start) end returnend ---------SELECT qUERY---------- SELECT Convert(Varchar(15), l.[date],101)as Date,COUNT(o.OrderID ) AS TotalOrders,ISNULL(Round(SUM(o.SubTotal),2),0) AS Amount , 1 as OrderByCol FROM dbo.CreateDateList(@DateFrom , @DateTo) l LEFT OUTER JOIN orders o ON o.Datecompleted >=Convert(Datetime, l.[date],101) and o.Datecompleted < dateadd(day,1,convert(Datetime, l.[date],101)) WHERE StoreID=@StoreID GROUP BY Convert(Varchar(15), l.[date],101) Union SELECT 'Grand Total' as Total,NULL AS TotalOrders, ISNULL(Round(SUM(o.SubTotal),2),0) AS Amount, 2 as OrderByCol FROM dbo.CreateDateList(@DateFrom , @DateTo) l LEFT OUTER JOIN orders o ON o.Datecompleted >=Convert(Datetime, l.[date],101) and o.Datecompleted < dateadd(day,1,convert(Datetime, l.[date],101)) WHERE StoreID=@StoreID Order by Date
View 6 Replies
View Related
Mar 17, 2008
Calculating time between two date In Sql Server 2005help me ..
View 3 Replies
View Related
May 3, 2007
I Apologize if this isn't the forum to ask this...
I have a MS Access (MDB) file with a table with 2 date fields, i want to read from a dialog on my app (on MS Visual .NET Studio 2005), here's the code I've been using do far:
Code Snippet
hr=theApp.m_cs.Open(theApp.m_ds);
if(SUCCEEDED(hr)) {
theApp.m_cs.StartTransaction();
theApp.m_cs.Commit();
CCommand< CDynamicAccessor > cmd;
CComBSTR query(_T("SELECT NumContrato, NumClie, FechaC, FechaCob, Inversion, NoCobrador, NoVendedor, Total, Plazo, Pagos FROM Contrato"));
CString string(query.m_str);
cmd.Open(theApp.m_cs,string);
hr = cmd.MoveFirst();
query=static_cast< BSTR >(cmd.GetValue(1));
CString csres(query.m_str);
this->m_numc=(int)*(query.m_str);
query=static_cast< BSTR >(cmd.GetValue(2));
m_numcte=(int)*(query.m_str);
query=static_cast< BSTR >(cmd.GetValue(3));
//m_fecc=(int)*(query.m_str);
MessageBox(csres);
theApp.m_cs.Close();
}
FechaC, FechaCob, are the two Dates I want to retrieve, but when I debug, it reads a 0 (zero) from the date fields, is there a limitation? can they be read? is there a special way to read them?
> thanks in advance!
-----
Me!
View 3 Replies
View Related
May 29, 2007
Hi,
where can i see how many days are left until the SQL 2005 Evaluation Edition expires after 180 days?
View 4 Replies
View Related
Jun 11, 2007
I set Report Parameters ,
Properties
Name : StartDate
Data Type : DateTime
Prompt : StartDate
Default values = Format(Today(),"yyyy/MM/dd")
But have error (An error occurred during local report rpocessing. The properly "DefaultValue" of report parameter 'EndDate' doesn't have the expected type.)
The Result show : like "2007/05/01"
Thanks help
View 9 Replies
View Related
Mar 7, 2008
Hi,
I am trying to schedule a report from Report Manager Interface (SSRS 2005) as below:
Scenario 1:
Start Date: GetDate() [today] e.g: 03/07/2008 (mm/dd/yyyy)
End Date: 31-dec-2009
Schedule: Monthly (Current Month) €“ Days: [any day in the Current Month which is < getdate()] e.g: March €“ 4th
Scenario 2:
Start Date: GetDate() [today] e.g: 03/07/2008 (mm/dd/yyyy)
End Date: 31-dec-2009
Schedule: Monthly (Less than Current Month) €“ Days: [any day] e.g: Feb €“ 12th
Scenario 3:
Start Date: GetDate() [today] e.g: 03/07/2008 (mm/dd/yyyy)
End Date: 31-dec-2009
Schedule: Monthly (Grater than Current Month) €“ Days: [any day] e.g: May €“ 10th
In all the above scenarios we observed a strange behavior of SSRS.
Scenario 1: Report is scheduled on 4th April 2008 where as it should be 4th March 2009.
Scenario 2: Report is scheduled on 12th Feb 2009 as expected.
Scenario 3: Report is scheduled on 10th May 2009 as expected.
Now, we changed the end date (31st Dec 2008) of scenario 1 as below:
Scenario 1:
Start Date: GetDate() [today] e.g: 03/07/2008 (mm/dd/yyyy)
End Date: 31-dec-2008
Schedule: Monthly (Current Month) €“ Days: [any day in the Current Month which is < getdate()] e.g: March €“ 4th
The next execution date is again 4th April 2008, which is wrong.
After scheduling the above reports we executed the below query in the ReportServer DB (SQL Prompt)
SELECT S.ScheduleId AS ScheduleId
, S.LastRunTime AS LastRunTime
, JA.Next_Scheduled_Run_Date AS NextRunTime
, RecurrenceType = CASE S.RecurrenceType
WHEN 1 THEN 'Once'
WHEN 2 THEN 'Hourly'
WHEN 3 THEN 'Daily'
WHEN 4 THEN 'Weekly'
WHEN 5 THEN 'Monthly'
WHEN 6 THEN 'Monthly'
END
FROM ReportServer.dbo.Schedule S WITH (NOLOCK)
Inner Join (
select j.name,max(ja.next_scheduled_run_date) as next_scheduled_run_date
from MSDB.dbo.SysJobActivity as ja WITH (NOLOCK)
inner join MSDB.dbo.SysJobs j WITH (NOLOCK) on ja.Job_ID = j.Job_ID
where ja.next_scheduled_run_date is not null and ja.next_scheduled_run_date >= Getdate()
group by j.name
) as JA on convert(nvarchar(256),S.ScheduleId) = convert(nvarchar(256),JA.name)
Where JA.name = (select top 1 name from msdb.dbo.sysJobs order by Date_Created desc )
-- Where JA.name in (select top 10 name from msdb.dbo.sysJobs order by Date_Created desc )
We have tried the same scenarios using the SSRS APIs. But unfortunately we received the same results.
Did anyone face this type of issue in past?
Is this a SSRS BUG or are we missing any point?
View 2 Replies
View Related
Oct 24, 2007
hi friends
i wish to set a date data type to a column "Date". when i use datetime format, the values is inserted in the U.S. date & time format. i want the values to be in the british english format. i.e dd/mm/yyyy only and does not require time value. can any one help me to insert the date values in the british english format
regards..,
sekar.
View 3 Replies
View Related
Jun 2, 2008
Greetings,I have an e-timesheet application.i made a function that takes the startdate of the week:public SqlDataReader GetProjectsActive(DateTime SheetDate) { SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["connectionString"]); SqlCommand myCommand = new SqlCommand("GetProjectsActive", myConnection); myCommand.CommandType = CommandType.StoredProcedure; SqlParameter parameterSheetDate = new SqlParameter("@SheetDate", SqlDbType.DateTime); parameterSheetDate.Value = SheetDate; myCommand.Parameters.Add(parameterSheetDate); myConnection.Open(); SqlDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection); return dr; } i run the application and i pass the value 6/1/2008 (date without time) to the GetProjectsActive but what i notice that the storedprocedure adds the current time to the passsed date when it has been executed so some projects will not appear since the startdate and enddate of the project are only dates so i try this solution: parameterSheetDate.Value = SheetDate.Date;and it works finebut my question why the current time has been added to the storedprocedure automatically although i pass only the date 6/1/2008 date????your help is highly appreciated.Best regards.
View 6 Replies
View Related
Jun 2, 2006
Hi everybody my problemis that i cannot create data base in vwd xpress edition when i right click on data connection the only enabled option it show is .."Add connections"create date base option is disable tell me or advised me what to do now ..???waiting for guru replies.regardsHussain
View 2 Replies
View Related
Feb 12, 2008
Hi,
I have written a reporting application which has a SQL2005 backend. An import routine into SQL, written by a 3rd party, frequently fails. The main problems are missing rows in certain tables.
I am going to write an SP that will accepts a from and to date. I then want to search for rows of type X between those dates that do not exist so we then know between a date range, we have no data for these XYZ days.
I have this working by returning all rows between the dates into a dataset, sorted by date, and then running through the rows and testing if the next rows date is the next expected date. This works but I think is a very poor solution. This is all done on the client in C#.
I want to learn and implement the most efficent way of doing this. My only solution in a SP was to make a temporary table of all dates between the date range for row type X and then do a right outer join against the data table, returning all rows which are missing.
Something like this:
SELECT twmd.date
FROM #temp_table_with_all_dates ttwad
RIGHT OUTER JOIN table_with_missing_date twmd
ON ttwad.date = twmd.date
WHERE twmd.date IS NULL
Would this be a good, efficent solution, or should I just stick to my processing of a dataset in C#?
Many thanks in advance,
CB
View 4 Replies
View Related