Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesHi all! Is there any function in SQL that I can use to get current date from workstation? All functions which I tried (now(), getdate() etc.) returns current date from server but I need date from workstation. Regards, Mirnes Lemes
Post Follow-up to this messagelemes_m@yahoo.com wrote: > Hi all! > > Is there any function in SQL that I can use to get current date from > workstation? All functions which I tried (now(), getdate() etc.) > returns current date from server but I need date from workstation. > > Regards, > > Mirnes Lemes You'll have to pass the date in as a parameter from the client end. -- David Portas, SQL Server MVP Whenever possible please post enough code to reproduce your problem. Including CREATE TABLE and INSERT statements usually helps. State what version of SQL Server you are using and specify the content of any error messages. SQL Server Books Online: http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx --
Post Follow-up to this messageThanks for your response.
First, I have to notice that I use MS Access 2003 as Front-End.
I was affraid that passing date is only way because I constructed other
stored procedures to use view to get some data. In this view I used <=
{ fn NOW() } to limit results and after that I joined all other stored
procedures to this view.
Now I got two problems: I tried to create function which uses @SomeDate
parameter to limit results but I can't get it work.
Another problem is how to pass @SomeDate value when I execute stored
procedure which is joined with this function...
Regards,
Post Follow-up to this messagelemes_m@yahoo.com (lemes_m@yahoo.com) writes:
> First, I have to notice that I use MS Access 2003 as Front-End.
I will have to notice that I don't know Access.
> Now I got two problems: I tried to create function which uses @SomeDate
> parameter to limit results but I can't get it work.
CREATE FUNCTION someorders (@somedate datetime) RETURNS TABLE AS
RETURN (SELECT OrderID, CustomerID
FROM Northwind.dbo.Orders
WHERE OrderDate >= @somedate)
go
select * from someorders ('19980101')
> Another problem is how to pass @SomeDate value when I execute stored
> procedure which is joined with this function...
Join a procedure with a function?
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread