Hello,
I'm writting a Crystal report on all order sent out in the past week.
I all works fine, but I am now trying to take away all the steps I can to make it easier and quicker to run.
The report has to inputs, the ClientCode and the Date Range.
Is there any way/Code that I can use to replace the need to input a date that will get the report to take todays date as the End range ( which is does at the moment ) and the - 7 days and use the result as the Start Range?
Thanks in advanceYou could use the LastFullWeek function in your record selection.
{table.field} = LastFullWeek
GJ
Showing posts with label steps. Show all posts
Showing posts with label steps. Show all posts
Thursday, March 22, 2012
Thursday, February 16, 2012
auto save query result to a text file
Is there an easy way to automate the following steps
from SQL server:
1. run a sql-query script (like "select * from ..." )
2. save the query result to a .txt or .rpt file in a
designated folder.
-i know i can write some c++ application to do this
but is there an easy way (like some simple script to be
run as scheduled task)
to do it ?
THANKS!The osql utility will do this for you. It can take a query as an input
parameter, and send its output to a file which is also specified as a
parameter.
The osql command can be called from a command file (.bat) so it can be
automated fully.
See the full osql syntax in Books Online.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"AMY" <anonymous@.discussions.microsoft.com> wrote in message
news:2bb7601c39331$37fc0650$a601280a@.phx.gbl...
> Is there an easy way to automate the following steps
> from SQL server:
> 1. run a sql-query script (like "select * from ..." )
> 2. save the query result to a .txt or .rpt file in a
> designated folder.
> -i know i can write some c++ application to do this
> but is there an easy way (like some simple script to be
> run as scheduled task)
> to do it ?
> THANKS!
>|||thank you Kalen, it's big help !
-amy
>--Original Message--
>The osql utility will do this for you. It can take a
query as an input
>parameter, and send its output to a file which is also
specified as a
>parameter.
>The osql command can be called from a command file (.bat)
so it can be
>automated fully.
>See the full osql syntax in Books Online.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"AMY" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2bb7601c39331$37fc0650$a601280a@.phx.gbl...
>> Is there an easy way to automate the following steps
>> from SQL server:
>> 1. run a sql-query script (like "select * from ..." )
>> 2. save the query result to a .txt or .rpt file in a
>> designated folder.
>> -i know i can write some c++ application to do this
>> but is there an easy way (like some simple script to be
>> run as scheduled task)
>> to do it ?
>> THANKS!
>>
>
>.
>
from SQL server:
1. run a sql-query script (like "select * from ..." )
2. save the query result to a .txt or .rpt file in a
designated folder.
-i know i can write some c++ application to do this
but is there an easy way (like some simple script to be
run as scheduled task)
to do it ?
THANKS!The osql utility will do this for you. It can take a query as an input
parameter, and send its output to a file which is also specified as a
parameter.
The osql command can be called from a command file (.bat) so it can be
automated fully.
See the full osql syntax in Books Online.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"AMY" <anonymous@.discussions.microsoft.com> wrote in message
news:2bb7601c39331$37fc0650$a601280a@.phx.gbl...
> Is there an easy way to automate the following steps
> from SQL server:
> 1. run a sql-query script (like "select * from ..." )
> 2. save the query result to a .txt or .rpt file in a
> designated folder.
> -i know i can write some c++ application to do this
> but is there an easy way (like some simple script to be
> run as scheduled task)
> to do it ?
> THANKS!
>|||thank you Kalen, it's big help !
-amy
>--Original Message--
>The osql utility will do this for you. It can take a
query as an input
>parameter, and send its output to a file which is also
specified as a
>parameter.
>The osql command can be called from a command file (.bat)
so it can be
>automated fully.
>See the full osql syntax in Books Online.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"AMY" <anonymous@.discussions.microsoft.com> wrote in
message
>news:2bb7601c39331$37fc0650$a601280a@.phx.gbl...
>> Is there an easy way to automate the following steps
>> from SQL server:
>> 1. run a sql-query script (like "select * from ..." )
>> 2. save the query result to a .txt or .rpt file in a
>> designated folder.
>> -i know i can write some c++ application to do this
>> but is there an easy way (like some simple script to be
>> run as scheduled task)
>> to do it ?
>> THANKS!
>>
>
>.
>
Subscribe to:
Posts (Atom)