Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Monday, March 26, 2012

no date retrun

hi all i have question about this procedure

when i write this the data return this is nice ok

USE [DigitalFirm]

GO

/****** Object: StoredProcedure [dbo].[SearchTaskName] Script Date: 05/31/2007 21:44:47 ******/

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

ALTERProcedure [dbo].[SearchTaskName]

(

@.TaskNamevarchar(50)

)

as

select a.TaskId,a.TaskName,p.fullName,a.Sdate,a.Fdate

from Assign_Task a,Task_Emp te,Personal p,Employee e

where te.TaskId=a.TaskIdand te.IDNO=e.IDNOand p.SSN=e.IDNOand a.TaskName=@.TaskName

and when i write this procedure in Sql server 2005

the i can show data and it is right and work

then when i want to exam this procedur in my web no have any data

please tell me why??

USE [DigitalFirm]

GO

/****** Object: StoredProcedure [dbo].[SearchTaskName] Script Date: 05/31/2007 21:44:47 ******/

SETANSI_NULLSON

GO

SETQUOTED_IDENTIFIERON

GO

ALTERProcedure [dbo].[SearchTaskName]

(

@.TaskNamevarchar(50)

)

as

select a.TaskId,a.TaskName,p.fullName,a.Sdate,a.Fdate

from Assign_Task a,Task_Emp te,Personal p,Employee e

where te.TaskId=a.TaskIdand te.IDNO=e.IDNOand p.SSN=e.IDNOand a.TaskNamelike'@.TaskName%'

thanx

Try this:

select a.TaskId,a.TaskName,p.fullName,a.Sdate,a.Fdatefrom Assign_Task a,Task_Emp te,Personal p,Employee ewhere te.TaskId=a.TaskIdand te.IDNO=e.IDNOand p.SSN=e.IDNOand a.TaskNamelike @.TaskName +'%'
|||

hi thanx mrndinakar you are nice manEmbarrassed

this is nice help for me .Stick out tongue

thanx

|||

it_amani:

hi thanx mrndinakar you are nice manEmbarrassed

this is nice help for me .Stick out tongue

thanx

You are welcome.Smile

|||

thax

mmmm

i want ask about another problem

when i update record from my web and i have value is null , the record not update

how i can solve this problem

thanx mrndinakar

|||

There could be lot of things involved. Post the UPDATE script you have. Does the script work if you run it from query analyzer?

|||

thanx i solve it . in incurved way(in arabic language toroq moltaweya)

but i wana to put my code and my query

Try

Dim idAsString

id = Request.QueryString("id").ToString()

If CheckBox1.Checked =TrueThen

fun.Update_Employee(id, fullname.Text, jobtitle.Text, salary.Text, sdate.Text, F_Date.Text, depno.SelectedValue, Active.SelectedValue, Username.Text, Pass.Text, Type.SelectedValue)

Label3.Text ="Update Employee Information are sucessful"

Else

fun.Update_Employee1(id, fullname.Text, jobtitle.Text, salary.Text, sdate.Text, depno.SelectedValue, Active.SelectedValue, Username.Text, Pass.Text, Type.SelectedValue)

Label3.Text ="Update Employee Information are sucessful"

EndIf

this is to the first Update

ALTERProcedure [dbo].[update_Employee]

(

@.IDNOnumeric(18,0),

@.fullNamevarchar(50),

@.Job_Titlevarchar(50),

@.Salaryint,

@.S_Datedatetime,

@.F_Datedatetime,

@.DepNonumeric(18,0),

@.Activebit,

@.Usernamevarchar(20),

@.Passvarchar(20),

@.ID_Type_idnumeric(18,0)

)

As

update Employeeset Job_Title=@.Job_Title,Salary=@.Salary,S_Date=@.S_Date,F_Date=@.F_Date,DepNo=@.DepNo,active=@.Active

where IDNO=@.IDNO

updateLogInset Username=@.Username,Pass=@.Pass,ID_Type_id=@.ID_Type_id

Where IDNO=@.IDNO

update Personalset fullName=@.fullName

Where SSN=@.IDNO

Catch exAs Exception

Label3.Text = ex.Message

and this to the second Update

ALTERProcedure [dbo].[update_Employee2]

(

@.IDNOnumeric(18,0),

@.fullNamevarchar(50),

@.Job_Titlevarchar(50),

@.Salaryint,

@.S_Datedatetime,

@.DepNonumeric(18,0),

@.Activebit,

@.Usernamevarchar(20),

@.Passvarchar(20),

@.ID_Type_idnumeric(18,0)

)

As

update Employeeset Job_Title=@.Job_Title,Salary=@.Salary,S_Date=@.S_Date,DepNo=@.DepNo,active=@.Active

where IDNO=@.IDNO

updateLogInset Username=@.Username,Pass=@.Pass,ID_Type_id=@.ID_Type_id

Where IDNO=@.IDNO

update Personalset fullName=@.fullName

WhereSSN=@.IDNO

thanx

No Date passed

I want to update a record that has a datetime field in it. But what if there is no parameter given for that field, i.e. what is the correct type/value to pass as parameter?

Example: A DOB field for a user profile, but the user doesn't enter his birthday

This is some example code that I use to update:


Private Sub UpdateDOB(ByVal dob As Date)

Dim parameters As SqlParameter() = { _
New SqlParameter("@.Birthday", SqlDbType.DateTime, 8)}

parameters(0).Value = dob

'Run Stored Procedure


This gives me the exception "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM" when I don't pass a valid date. I tried passingNothing but same error (in this case it convert dob to "#12:00:00 AM#")

The only thing I can think of is to use Date.MaxValue and then check in application logic, but there must be a better way!use dbnull.value

hth|||ndinakar, I tried this:

User.DOB = System.DBNull.Value

but then I get an error, DBNull.Value cannot be converted to Type Date
how should i assign DBNull.Value ?|||Instead of passing DOB as date pass it as string


Private Sub UpdateDOB(ByVal strDOB As string)
...
cmd.Parameters.Add(New SqlParameter("@.Birthday", SqlDbType.DateTime))

If (strDOB= "") Then
cmd.Parameters("@.Date").Value = sqldatenull
'cmd.Parameters("@.Date").Value = DBNull.Value
Else
cmd.Parameters("@.Date").Value = DateTime.Parse(strDOB)
End If

HTH|||or this :


myCommand.Parameters.Add(New SqlParameter("@.cusbday",SqlDbType.datetime))
If len(trim(bday.Text)) = 0 Then
myCommand.Parameters("@.cusbday").Value = SqlDateTime.null
Else
myCommand.Parameters("@.cusbday").Value = server.htmlencode(DateTime.Parse(bday.Text))
End If

you need to import system.data.sqldypes namespace.

hth|||Thank you

SqlDateTime.Null worked fine as parameter.sql

Monday, March 12, 2012

Next Version of SQL Server ?

Anyone know a (proposed) release date of the next version of SQL Server ?Second half of this year. You won't get a more specific date this early.
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Liz" <liz@.tiredofspam.com> wrote in message
news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
quote:

> Anyone know a (proposed) release date of the next version of SQL Server ?
>
|||"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:uDPFb#16DHA.3896@.TK2MSFTNGP11.phx.gbl...
quote:

> Second half of this year. You won't get a more specific date this early.

Thanks, Aaron
quote:

> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Liz" <liz@.tiredofspam.com> wrote in message
> news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
?[QUOTE]
>

Next Version of SQL Server ?

Anyone know a (proposed) release date of the next version of SQL Server ?Second half of this year. You won't get a more specific date this early.
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Liz" <liz@.tiredofspam.com> wrote in message
news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
> Anyone know a (proposed) release date of the next version of SQL Server ?
>|||"Aaron Bertrand - MVP" <aaron@.TRASHaspfaq.com> wrote in message
news:uDPFb#16DHA.3896@.TK2MSFTNGP11.phx.gbl...
> Second half of this year. You won't get a more specific date this early.
Thanks, Aaron
> --
> Aaron Bertrand
> SQL Server MVP
> http://www.aspfaq.com/
>
>
> "Liz" <liz@.tiredofspam.com> wrote in message
> news:uNcyx516DHA.2416@.TK2MSFTNGP10.phx.gbl...
> > Anyone know a (proposed) release date of the next version of SQL Server
?
> >
> >
>

Next run date!

Hi,
Yesterday I changed a motherboard on my SQL server 7.0.
Today I noticed that jobs has not been started last night,
and I noticed that date is wrong on this machine,so I did
set the date and time and rebooted the machine, however
still can not see the next run date on scheduled job, even
if I create a new job, I can not see that. Does anyone
know how to fix this?
Thanks in advance-Rob
Hi Rob,
I learned the Job of SQL Server 7.0 did not start after changing the
motherboard and you cannot see the value of "Next run date" property of the
job. As far as I know, after changing the motherboard of the machine,
generally, the old operation system will crash. Do you mean your old
operation system is still available and there is not any problem?
According to your description, it seems all the jobs on your problematic
machine have this problem. If I have misunderstood, please feel free to let
me know. Have you started the SQL Server agent? If the problem still
occurred after starting SQL Server agent, what's the message in the Next
Run Date field of the problematic job?
I am looking forward to hearing from you soon.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
|||Hi Rob,
How is the issue going on your side? Do you mean that the "Next Run Date"
column shows "(Date and Time are not available)" value? Even for a newly
created job although it has a valid schedule?
1. Please check again to see if the SQL Server Agent Service is started and
the jobs are enabled.
Right click on one of the jobs -> properties -> schedules tab -> make sure
there is a schedule set up for this job.
If so -> choose the schedule -> edit -> make sure the schedule is enabled
(checkbox is checked)
If not, check it and click ok and apply.
Now, right click on "Jobs" under SQL Server Agent and choose refresh. Check
if the next run date column shows any values. If so, please check each and
every single job to check if the schedule has been enabled.
2. If it still does not help, check in the MSDB database to see if you can
see the date but not in the GUI? Try the following SQL statement.
Select schedule_id, name, next_run_date, next_run_time from sysjobschedules
3. If it also does not show up in MSDB database, please try to run DBCC
CHECKDB against the MSDB database. Also, please enable and provide the SQL
Server Agent log.
For more information regarding SQL Server Agent log, please see the
following article on SQL Server Books Online.
Topic: "SQL Server Agent Properties (General Tab)"
4. If the date shows correctly in the MSDB database, check if an end date
has been specified for the job schedule and if it is already past the end
date?
5. Please run sp_help_job against the jobs to see if the next_run_date and
next_run_time shows correctly?
sp_help_job @.job_name = '<job_name>'
I am looking forward to hearing from you soon.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Next run date!

Hi,
Yesterday I changed a motherboard on my SQL server 7.0.
Today I noticed that jobs has not been started last night,
and I noticed that date is wrong on this machine,so I did
set the date and time and rebooted the machine, however
still can not see the next run date on scheduled job, even
if I create a new job, I can not see that. Does anyone
know how to fix this?
Thanks in advance-RobHi Rob,
I learned the Job of SQL Server 7.0 did not start after changing the
motherboard and you cannot see the value of "Next run date" property of the
job. As far as I know, after changing the motherboard of the machine,
generally, the old operation system will crash. Do you mean your old
operation system is still available and there is not any problem?
According to your description, it seems all the jobs on your problematic
machine have this problem. If I have misunderstood, please feel free to let
me know. Have you started the SQL Server agent? If the problem still
occurred after starting SQL Server agent, what's the message in the Next
Run Date field of the problematic job?
I am looking forward to hearing from you soon.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.|||Hi Rob,
How is the issue going on your side? Do you mean that the "Next Run Date"
column shows "(Date and Time are not available)" value? Even for a newly
created job although it has a valid schedule?
1. Please check again to see if the SQL Server Agent Service is started and
the jobs are enabled.
Right click on one of the jobs -> properties -> schedules tab -> make sure
there is a schedule set up for this job.
If so -> choose the schedule -> edit -> make sure the schedule is enabled
(checkbox is checked)
If not, check it and click ok and apply.
Now, right click on "Jobs" under SQL Server Agent and choose refresh. Check
if the next run date column shows any values. If so, please check each and
every single job to check if the schedule has been enabled.
2. If it still does not help, check in the MSDB database to see if you can
see the date but not in the GUI? Try the following SQL statement.
Select schedule_id, name, next_run_date, next_run_time from sysjobschedules
3. If it also does not show up in MSDB database, please try to run DBCC
CHECKDB against the MSDB database. Also, please enable and provide the SQL
Server Agent log.
For more information regarding SQL Server Agent log, please see the
following article on SQL Server Books Online.
Topic: "SQL Server Agent Properties (General Tab)"
4. If the date shows correctly in the MSDB database, check if an end date
has been specified for the job schedule and if it is already past the end
date?
5. Please run sp_help_job against the jobs to see if the next_run_date and
next_run_time shows correctly?
sp_help_job @.job_name = '<job_name>'
I am looking forward to hearing from you soon.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Friday, March 9, 2012

Next Run Date column not sorting

We've just installed SQL Server 2000 on one of our servers and have
noticed a strange behavior. When clicking the column headings in the
job display in Enterprise Manager, the list is sorted (first click
ascending, then descending) on the column clicked except for "Next Run
Date." When we click on "Next Run Date," the list is reordered, but
randomly. Each time we click it we get a different order but never
ascending or descending. This is true whether we're at the server or
on a remote machine. We never saw this behavior with SQL Server 7.0.

Any ideas? Thanks!"Rich Hurley" <Rich.Hurley@.mci.com> wrote in message
news:e3153db3.0410110535.129c4159@.posting.google.c om...
> We've just installed SQL Server 2000 on one of our servers and have
> noticed a strange behavior. When clicking the column headings in the
> job display in Enterprise Manager, the list is sorted (first click
> ascending, then descending) on the column clicked except for "Next Run
> Date." When we click on "Next Run Date," the list is reordered, but
> randomly. Each time we click it we get a different order but never
> ascending or descending. This is true whether we're at the server or
> on a remote machine. We never saw this behavior with SQL Server 7.0.
> Any ideas? Thanks!

The problem with Enterprise Manager is that you never really know what it's
doing. If you run a SELECT query with an ORDER BY clause in Query Analyzer,
does it return the correct order? QA is a much better and simpler tool for
retreiving and manipulating data than EM, because there's no guesswork
involved and you can control exactly what data you retrieve and how.

Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message news:<416ad914_2@.news.bluewin.ch>...
> "Rich Hurley" <Rich.Hurley@.mci.com> wrote in message
> news:e3153db3.0410110535.129c4159@.posting.google.c om...
> The problem with Enterprise Manager is that you never really know what it's
> doing. If you run a SELECT query with an ORDER BY clause in Query Analyzer,
> does it return the correct order? QA is a much better and simpler tool for
> retreiving and manipulating data than EM, because there's no guesswork
> involved and you can control exactly what data you retrieve and how.
> Simon

ORDER BY works fine in QA. Ordering also works fine in other columns
of the job list in Ent. Mgr. The "Next Run Date" column is the only
one that is acting weird. If I use SQL 2000 Ent. Mgr. from my laptop
to look at any of our servers (4 SQL 7.0 & 1 SQL 2000) the same
behavior occurs. Ent. Mgr. on our 7.0 servers works fine but, of
course, cannot connect to the 2000 server.

Rich|||"Rich Hurley" <Rich.Hurley@.mci.com> wrote in message
news:e3153db3.0410120501.7ab303bc@.posting.google.c om...
> "Simon Hayes" <sql@.hayes.ch> wrote in message
> news:<416ad914_2@.news.bluewin.ch>...
>> "Rich Hurley" <Rich.Hurley@.mci.com> wrote in message
>> news:e3153db3.0410110535.129c4159@.posting.google.c om...
>>
>> The problem with Enterprise Manager is that you never really know what
>> it's
>> doing. If you run a SELECT query with an ORDER BY clause in Query
>> Analyzer,
>> does it return the correct order? QA is a much better and simpler tool
>> for
>> retreiving and manipulating data than EM, because there's no guesswork
>> involved and you can control exactly what data you retrieve and how.
>>
>> Simon
> ORDER BY works fine in QA. Ordering also works fine in other columns
> of the job list in Ent. Mgr. The "Next Run Date" column is the only
> one that is acting weird. If I use SQL 2000 Ent. Mgr. from my laptop
> to look at any of our servers (4 SQL 7.0 & 1 SQL 2000) the same
> behavior occurs. Ent. Mgr. on our 7.0 servers works fine but, of
> course, cannot connect to the 2000 server.
> Rich

If it's a date column, then perhaps some sort of regional settings issue
might be causing it? Although if it works properly in QA, then I personally
wouldn't worry about it; EM has plenty of other data manipulation issues
anyway, as described in some detail here:

http://www.aspfaq.com/show.asp?id=2455

Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message news:<416bd8fc$1_3@.news.bluewin.ch>...
> If it's a date column, then perhaps some sort of regional settings issue
> might be causing it? Although if it works properly in QA, then I personally
> wouldn't worry about it; EM has plenty of other data manipulation issues
> anyway, as described in some detail here:
> http://www.aspfaq.com/show.asp?id=2455
> Simon

If the job list was sorted consistently when I click on the column
heading I'd believe it was a regional setting. But everytime I click
the "Next Run Time" heading, I get a random result. The other columns
sort ascending on the first click and descending on a second click and
continue to flip-flop as many times as they are clicked. Not so with
the "Next Run Time" column. There's no rhyme or reason to the order
that jobs are displayed no matter how many times I click -- it's
different each time -- not just a reverse of the previous display.

QA doesn't help when managing jobs -- as the article points out EM is
the preferred tool for that -- QA queries would simply be too long and
too complex. I'm just puzzled by what could cause this weird behavior
in EM.

Thanks,
Rich

next run date

I am setting up a new job that will run weekly. However, after setting up the
job the "NEXT RUN DATE" does not display. If I set up this job on another
server this date does get displayed. What might be the reason for this
behavior?
Can you post the results of the following query here:
SELECT * FROM msdb..sysjobschedules s1
WHERE EXISTS ( SELECT * FROM msdb..sysjobs s2
WHERE s2.job_id = s1.job_id )
AND s2.name = <jobname> );
Replace <jobname> with the name of your job.
Anith
|||Hi,
Below are the results:
schedule_id job_id name
enabled
-- --
37 DE69831F-F6EA-4E71-89B3-6542F82A8D2F test1
freq_typefreq_intervalfreq_subday_typefreq_subday_interval
8 4 1 0
freq_relative_intervalfreq_recurrence_factor
active_start_dateactive_end_date
0 1 2008031099991231
active_start_timeactive_end_timenext_run_datenext_run_time
100000 235959 0 0
date_created
03/10/2008 15:27:27.27
"Anith Sen" wrote:

> Can you post the results of the following query here:
> SELECT * FROM msdb..sysjobschedules s1
> WHERE EXISTS ( SELECT * FROM msdb..sysjobs s2
> WHERE s2.job_id = s1.job_id )
> AND s2.name = <jobname> );
> Replace <jobname> with the name of your job.
> --
> Anith
>
>
|||I see that the next_run_date and next_run_time is not getting inserted into
the sysjobschedules table in msdb database after I create the job. What might
be the reason that this is not getting inserted? This works correctly on
other servers. Is this a permissions issue?
Thanks in advance.
"ronnie" wrote:
[vbcol=seagreen]
> Hi,
> Below are the results:
> schedule_id job_id name
> enabled
> -- --
> --
> 37 DE69831F-F6EA-4E71-89B3-6542F82A8D2F test1
> freq_typefreq_intervalfreq_subday_typefreq_subday_interval
> ----
> 8 4 1 0
> freq_relative_intervalfreq_recurrence_factor
> active_start_dateactive_end_date
> --
> 0 1 2008031099991231
>
> active_start_timeactive_end_timenext_run_datenext_run_time
> ----
> 100000 235959 0 0
>
> date_created
> --
> 03/10/2008 15:27:27.27
>
>
>
>
>
> "Anith Sen" wrote:

next run date

I am setting up a new job that will run weekly. However, after setting up the
job the "NEXT RUN DATE" does not display. If I set up this job on another
server this date does get displayed. What might be the reason for this
behavior?Can you post the results of the following query here:
SELECT * FROM msdb..sysjobschedules s1
WHERE EXISTS ( SELECT * FROM msdb..sysjobs s2
WHERE s2.job_id = s1.job_id )
AND s2.name = <jobname> );
Replace <jobname> with the name of your job.
--
Anith|||Hi,
Below are the results:
schedule_id job_id name
enabled
-- --
-- --
37 DE69831F-F6EA-4E71-89B3-6542F82A8D2F test 1
freq_type freq_interval freq_subday_type freq_subday_interval
-- -- -- --
8 4 1 0
freq_relative_interval freq_recurrence_factor
active_start_date active_end_date
-- --
-- --
0 1 20080310 99991231
active_start_time active_end_time next_run_date next_run_time
-- -- -- --
100000 235959 0 0
date_created
--
03/10/2008 15:27:27.27
"Anith Sen" wrote:
> Can you post the results of the following query here:
> SELECT * FROM msdb..sysjobschedules s1
> WHERE EXISTS ( SELECT * FROM msdb..sysjobs s2
> WHERE s2.job_id = s1.job_id )
> AND s2.name = <jobname> );
> Replace <jobname> with the name of your job.
> --
> Anith
>
>|||I see that the next_run_date and next_run_time is not getting inserted into
the sysjobschedules table in msdb database after I create the job. What might
be the reason that this is not getting inserted? This works correctly on
other servers. Is this a permissions issue?
Thanks in advance.
"ronnie" wrote:
> Hi,
> Below are the results:
> schedule_id job_id name
> enabled
> -- --
> -- --
> 37 DE69831F-F6EA-4E71-89B3-6542F82A8D2F test 1
> freq_type freq_interval freq_subday_type freq_subday_interval
> -- -- -- --
> 8 4 1 0
> freq_relative_interval freq_recurrence_factor
> active_start_date active_end_date
> -- --
> -- --
> 0 1 20080310 99991231
>
> active_start_time active_end_time next_run_date next_run_time
> -- -- -- --
> 100000 235959 0 0
>
> date_created
> --
> 03/10/2008 15:27:27.27
>
>
>
>
>
> "Anith Sen" wrote:
> > Can you post the results of the following query here:
> >
> > SELECT * FROM msdb..sysjobschedules s1
> > WHERE EXISTS ( SELECT * FROM msdb..sysjobs s2
> > WHERE s2.job_id = s1.job_id )
> > AND s2.name = <jobname> );
> >
> > Replace <jobname> with the name of your job.
> >
> > --
> > Anith
> >
> >
> >

Next Release?

Hello,

I've tried searching for details on the next release date of SSRS, but can't find any. Has anyone heard anything regarding the next release? There are at least a dozen features that I really would like to have, and when searching for each, the MSFT developer typically responds with "that feature is targeted for a future release". So I'd like to know if anyone has any idea, even heard a rumor, regarding the next release timeline. Or, is there a better place to search for this information?

Thanks!

Michael

The June CTP of SQL Server 2008 is out

http://connect.microsoft.com/sqlserver

As far as I know, you are best to use the connect site above and the MSDN sites here

http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=428&SiteID=1

Next Friday

I have a table called Order, within which there is a field called orderdate,
I can I program so that I can always retrieve order with an order date as
next Friday when I am running this script anytime this w.
Thanks,
QjleeHi
You can work this out using a calendar table see
http://www.aspfaq.com/show.asp?id=2519 or use the dataadd and datepart
functions (see books online).
John
"qjlee" wrote:

> I have a table called Order, within which there is a field called orderdat
e,
> I can I program so that I can always retrieve order with an order date as
> next Friday when I am running this script anytime this w.
> Thanks,
> Qjlee|||You can solve it by using the DATEPART() function like this:
declare @.today smalldatetime
set @.today = '20051102'
create table #tmp
(
ID int identity(1,1) primary key clustered,
OrderDate smalldatetime null
)
set nocount on
insert into #tmp (OrderDate) values ('20051101')
insert into #tmp (OrderDate) values ('20051101')
insert into #tmp (OrderDate) values ('20051102')
insert into #tmp (OrderDate) values ('20051103')
insert into #tmp (OrderDate) values ('20051103')
insert into #tmp (OrderDate) values ('20051104')
insert into #tmp (OrderDate) values ('20051104')
insert into #tmp (OrderDate) values ('20051104')
insert into #tmp (OrderDate) values ('20051107')
insert into #tmp (OrderDate) values ('20051108')
insert into #tmp (OrderDate) values ('20051108')
insert into #tmp (OrderDate) values ('20051109')
insert into #tmp (OrderDate) values ('20051110')
insert into #tmp (OrderDate) values ('20051110')
insert into #tmp (OrderDate) values ('20051111')
insert into #tmp (OrderDate) values ('20051111')
insert into #tmp (OrderDate) values ('20051111')
set nocount off
select * from #tmp
where OrderDate =
(
select min(OrderDate) from #tmp -- Earliest...
where datepart(dw,OrderDate) = 6 -- Friday...
and OrderDate >= @.today -- on or after "today"
)
drop table #tmp
The DATEPART() function, when used with the 'dw' parameter, returns the
day of the w and is dependant on how you have the SET DATEFIRST
setting configured. For me, Friday = 6. Also, if your OrderDate column
contains time info as well then you'll need to do a little range
checking to make sure the OrderDate is somewhere on that day (and not
just at midnight) - there are heaps of references on how to do that (I'm
sure I've seen an example on http://aspfaq.com).
*mike hodgson*
blog: http://sqlnerd.blogspot.com
qjlee wrote:

>I have a table called Order, within which there is a field called orderdate
,
>I can I program so that I can always retrieve order with an order date as
>next Friday when I am running this script anytime this w.
>Thanks,
>Qjlee
>|||Try this:
SELECT CURRENT_TIMESTAMP + (6-DATEPART(dw,'2005-11-02'))
Mark Graveline
Take The Challenge
http://www.sqlchallenge.com
--|||Qjlee,
This should always give you the Friday in the w following
the current one, assuming your w begins on Monday.
dateadd(d,datediff(d,'19000101',getdate(
))/7*7+11,'19000101')
Steve Kass
Drew University
qjlee wrote:

>I have a table called Order, within which there is a field called orderdate
,
>I can I program so that I can always retrieve order with an order date as
>next Friday when I am running this script anytime this w.
>Thanks,
>Qjlee
>|||Try this instead:
SELECT CURRENT_TIMESTAMP + (6-DATEPART(dw,CURRENT_TIMESTAMP))
Thanks,
M. E. Houston
"SQLChallenge" <sqlchallenge@.saikoconsulting.com> wrote in message
news:1131062936.928610.144390@.g47g2000cwa.googlegroups.com...
> Try this:
> SELECT CURRENT_TIMESTAMP + (6-DATEPART(dw,'2005-11-02'))
> --
> Mark Graveline
> Take The Challenge
> http://www.sqlchallenge.com
> --
>

Next CTP date?

Is there an estimate on the next CTP release date?

It would be cool to just mark it on my calendar instead of having to drop in to see if I missed it.

Thanks!

Hello,

The date for the next CTP has not yet been announced. Sorry, but you'll have to check back

Best regards,

Chris

Next CTP date?

Is there an estimate on the next CTP release date?

It would be cool to just mark it on my calendar instead of having to drop in to see if I missed it.

Thanks!

Hello,

The date for the next CTP has not yet been announced. Sorry, but you'll have to check back

Best regards,

Chris

next 30 days or all values

Hi,
I have a dataset and I need to be able to filter that data based on
Completion Date.
I have created a user parameter is SSRS with the following values:
0 = All Dates
1 = Next 30 days
I am trying to filter my dataset but I don't know how to filter this
based on my user parameter.
Help!
JasonI figured it out
if the user selects "All" then Parameter!Completion.Value = 0
if the user selects "Next 30 Days" then Parameter!Completion.Value = 1
so my filter looks like:
=iif (Parameters!Completion.Value=1, date.Today.AddDays(30),
date.MaxValue)

News with database

hi how i can make news bar related with DB ?

i have 2 table for news one for newsName,primary key(newsID), descNews,date,forign(flagNo) _ and another for kind of user (primary(kindID),flagName

i want to display news in different page each page display news for one kinde of user

means iwant to make

select newsID,newsName from News where (flageNo=1)

oR(flageNo=2)

pleaaaaaaaaaaase help me to make this in details

thank you for each member help me

>hi how i can make news bar related with DB ?
Could you explain more clearly what you are trying to achieve?

Wednesday, March 7, 2012

News / Article Application Storage

Hi,

I'm building a straightforward-ish news site. Currently, the story details (e.g. headline, description, author, date) are stored in a SQL DB. The news is categorised and the category details are also stored in an SQL table.

However - what is the best way to store the actual news article?

At the moment, when the user enters a story, they input the details and article text. The details are saved in the DB and the text is saved as an XML file with filename corresponding to the article DB primary key. When the story is "read" the app pulls the details from the DB and loads up the appropriate XML file from disk.

For various reasons, I need to keep the article stored as XML, either in a file or in the DB. The DB provides for faster sorting and retrieval, and I don't want to store large amounts of data (i.e. the article itself) in the DB if avoidable.

I guess there are a few ways to do it -

1. Store details in DB and article as XML file.
2. Store details and article in same DB table
3. Store details in one DB table and articles in another

I would imagine that 3 would be the best, but would there be a performance hit? What is the maximum size of field (i.e. article size) I can have in a table?

Cheers

Graham Wilson.

I'm using choice 2 in my application.

In DB design, there is no need to use different tables for fields that can be in one table.

HTH
Regards

|||

OK, thanks.

My reasoning behind using two tables was because I was unsure if having a lot of data in one table would slow down any retrieval or searching?

|||

pipelineconsulting:

OK, thanks.

My reasoning behind using two tables was because I was unsure if having a lot of data in one table would slow down any retrieval or searching?

I don't think that will do any performance changes.