|
Home > Archive > Microsoft SQL Server forum > January 2006 > Workstation date
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| lemes_m@yahoo.com 2006-01-31, 8:23 pm |
| 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
| |
| David Portas 2006-01-31, 8:23 pm |
| lemes_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
--
| |
| lemes_m@yahoo.com 2006-01-31, 8:23 pm |
| Thanks 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,
| |
| Erland Sommarskog 2006-01-31, 8:23 pm |
| lemes_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
|
|
|
|
|