Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Thursday, March 22, 2012

Bar chart report(grouping datetime info yearly, monthly, etc...)

hello,

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

One possible solution is to create two separate graphs. For the first graph, you can use years as the increments. For the second graph, you can use months as the increments. Then, create a visibility expression using IIF to show one graph when the range between the dates meets the requirements, This will enable you to determine which graph is visible to the user based on the range between the dates.

I understand this isn't the most efficient solution, but it will at least solve your problem.

|||

Hi Joel,

That was not my question. As I mentioned earlier, I want to change the x-axis value based on the parameters value. The main thing is grouping the datetime info based on the parameter condition(yearly, monthly, etc.) as I mentioned earlier. Please refer the highlighted values in the previous post. On the top of that, the two examples that I mentioned earlier are just two conditions, I might need to add another conditions such as weekly, daily and hourly basis reports.

Sincerely,

Amde

|||

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

|||

Hi guys,

Is this question not clear or difficult to answer? Does any body came across this kind of scenario?

Please let me know?

Sincerely,

Amde

sql

Bar chart report

hello,

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

One possible solution is to create two separate graphs. For the first graph, you can use years as the increments. For the second graph, you can use months as the increments. Then, create a visibility expression using IIF to show one graph when the range between the dates meets the requirements, This will enable you to determine which graph is visible to the user based on the range between the dates.

I understand this isn't the most efficient solution, but it will at least solve your problem.

|||

Hi Joel,

That was not my question. As I mentioned earlier, I want to change the x-axis value based on the parameters value. The main thing is grouping the datetime info based on the parameter condition(yearly, monthly, etc.) as I mentioned earlier. Please refer the highlighted values in the previous post. On the top of that, the two examples that I mentioned earlier are just two conditions, I might need to add another conditions such as weekly, daily and hourly basis reports.

Sincerely,

Amde

|||

I am creating a bar chart report which contains a datetime information on the x -axis. The unit of the x-axis value depends on the parameters value(StartDate and EndDate). For example, if the difference between StartDate and EndDate is > 2 years, say 4 years for instance, then the value of the x-axis should be presented on a yearly basis, like this:


2001-03-04 2002-03-04 2003-03-04 2004-03-04

Assume the line is the x-axis of the bar chart and 2001-03-04 and 2004-03-04 are the StartDate and EndDate respectively.

Similarly,if the difference between the StartDate and EndDate is between 4 months and 2 years, say 5 months for instance, then the value fo the x-axis should presented on a monthly basis, like this:


2006-03-04 2006-04-04 2006-05-04 2006-06-04 2006-07-04

Assume the line is the x-axis of the bar chart and 2006-03-04 and 2006-07-04 are the StartDate and EndDate respectively.

Please let me know if anybody has came across similar situation.

Any idea is appreciable.

Sincerely,

Amde

|||

Hi guys,

Is this question not clear or difficult to answer? Does any body came across this kind of scenario?

Please let me know?

Sincerely,

Amde

Bar Chart Question

I am creating a bar chart which contains a category for days of the week and
various values for data. I need to add a total bar that sums values for the
week. Total is not available from the dataset and the category, which is a
field from the dataset doesn't have a value for total either. Has anybody out
there attempted to built something like this?I did a similar thing.
I made it available in the dataset by doing a
union select 'Total', Sum[theData]
This will add total to the column with the single value names which will
have the total value in the value column.
then it will automatically be in your graph.
Hopw that helps, explanation was a bit rubbish
"Johnny C" <JohnnyC@.discussions.microsoft.com> wrote in message
news:8DD592D3-6FD8-4CCB-B9F2-E2918B29C9DA@.microsoft.com...
>I am creating a bar chart which contains a category for days of the week
>and
> various values for data. I need to add a total bar that sums values for
> the
> week. Total is not available from the dataset and the category, which is a
> field from the dataset doesn't have a value for total either. Has anybody
> out
> there attempted to built something like this?

Thursday, March 8, 2012

Backups with filename macros

Greetings, I think this should have a simple answer (whether yes or no).
I would like to make backups to a file in which the filename contains the day of the week. I would assume I could use %d or something like that to do macro substition for the current DOW.
Here is what I am doing (so that this makes more sense):
Right click on your database, All Tasks --> Backup Database...
In the "Destination" section, I am adding a Disk destination and specifying a filename, such as "db_monday.sqlbackup" and "db_tuesday.sqlbackup", then consequently setting the schedule to backup every Monday, Tuesday, etc. I would like to set the schedul
e to backup every day, but specify a macro in the filename to substitute the day of the week. I have tried putting in "db_%d.sqlbackup", but the backup then creates a file named exactly that.
Is this possible to do? If so, how?
Thanks in advance,
Hegg
You could build some dynamic SQL to do that, something like below.
declare @.cmd varchar(100)
set @.cmd='BACKUP DATABASE YOURDB TO DISK=''C:\temp\DB' +
datename(weekday,getdate()+1) + '.sqlbackup'''
exec (@.cmd)
----
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Hegg" <hegg@.netwidedev.com> wrote in message
news:9A9889C3-E278-47B6-90D9-BD1E12BAB623@.microsoft.com...
> Greetings, I think this should have a simple answer (whether yes or no).
> I would like to make backups to a file in which the filename contains the
day of the week. I would assume I could use %d or something like that to do
macro substition for the current DOW.
> Here is what I am doing (so that this makes more sense):
> Right click on your database, All Tasks --> Backup Database...
> In the "Destination" section, I am adding a Disk destination and
specifying a filename, such as "db_monday.sqlbackup" and
"db_tuesday.sqlbackup", then consequently setting the schedule to backup
every Monday, Tuesday, etc. I would like to set the schedule to backup
every day, but specify a macro in the filename to substitute the day of the
week. I have tried putting in "db_%d.sqlbackup", but the backup then
creates a file named exactly that.
> Is this possible to do? If so, how?
> Thanks in advance,
> Hegg
|||MiniSQLBackup allows you to use macros for backup type, server, instance and
database names, and the current date time elements, in addition to
generating smaller and encrypted backup files.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Hegg" <hegg@.netwidedev.com> wrote in message
news:9A9889C3-E278-47B6-90D9-BD1E12BAB623@.microsoft.com...
> Greetings, I think this should have a simple answer (whether yes or no).
> I would like to make backups to a file in which the filename contains the
day of the week. I would assume I could use %d or something like that to do
macro substition for the current DOW.
> Here is what I am doing (so that this makes more sense):
> Right click on your database, All Tasks --> Backup Database...
> In the "Destination" section, I am adding a Disk destination and
specifying a filename, such as "db_monday.sqlbackup" and
"db_tuesday.sqlbackup", then consequently setting the schedule to backup
every Monday, Tuesday, etc. I would like to set the schedule to backup
every day, but specify a macro in the filename to substitute the day of the
week. I have tried putting in "db_%d.sqlbackup", but the backup then
creates a file named exactly that.
> Is this possible to do? If so, how?
> Thanks in advance,
> Hegg

Backups with filename macros

Greetings, I think this should have a simple answer (whether yes or no).
I would like to make backups to a file in which the filename contains the da
y of the week. I would assume I could use %d or something like that to do m
acro substition for the current DOW.
Here is what I am doing (so that this makes more sense):
Right click on your database, All Tasks --> Backup Database...
In the "Destination" section, I am adding a Disk destination and specifying
a filename, such as "db_monday.sqlbackup" and "db_tuesday.sqlbackup", then c
onsequently setting the schedule to backup every Monday, Tuesday, etc. I wo
uld like to set the schedul
e to backup every day, but specify a macro in the filename to substitute the
day of the week. I have tried putting in "db_%d.sqlbackup", but the backup
then creates a file named exactly that.
Is this possible to do? If so, how?
Thanks in advance,
HeggYou could build some dynamic SQL to do that, something like below.
declare @.cmd varchar(100)
set @.cmd='BACKUP DATABASE YOURDB TO DISK=''C:\temp\DB' +
datename(weekday,getdate()+1) + '.sqlbackup'''
exec (@.cmd)
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Hegg" <hegg@.netwidedev.com> wrote in message
news:9A9889C3-E278-47B6-90D9-BD1E12BAB623@.microsoft.com...
> Greetings, I think this should have a simple answer (whether yes or no).
> I would like to make backups to a file in which the filename contains the
day of the week. I would assume I could use %d or something like that to do
macro substition for the current DOW.
> Here is what I am doing (so that this makes more sense):
> Right click on your database, All Tasks --> Backup Database...
> In the "Destination" section, I am adding a Disk destination and
specifying a filename, such as "db_monday.sqlbackup" and
"db_tuesday.sqlbackup", then consequently setting the schedule to backup
every Monday, Tuesday, etc. I would like to set the schedule to backup
every day, but specify a macro in the filename to substitute the day of the
week. I have tried putting in "db_%d.sqlbackup", but the backup then
creates a file named exactly that.
> Is this possible to do? If so, how?
> Thanks in advance,
> Hegg|||MiniSQLBackup allows you to use macros for backup type, server, instance and
database names, and the current date time elements, in addition to
generating smaller and encrypted backup files.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Hegg" <hegg@.netwidedev.com> wrote in message
news:9A9889C3-E278-47B6-90D9-BD1E12BAB623@.microsoft.com...
> Greetings, I think this should have a simple answer (whether yes or no).
> I would like to make backups to a file in which the filename contains the
day of the week. I would assume I could use %d or something like that to do
macro substition for the current DOW.
> Here is what I am doing (so that this makes more sense):
> Right click on your database, All Tasks --> Backup Database...
> In the "Destination" section, I am adding a Disk destination and
specifying a filename, such as "db_monday.sqlbackup" and
"db_tuesday.sqlbackup", then consequently setting the schedule to backup
every Monday, Tuesday, etc. I would like to set the schedule to backup
every day, but specify a macro in the filename to substitute the day of the
week. I have tried putting in "db_%d.sqlbackup", but the backup then
creates a file named exactly that.
> Is this possible to do? If so, how?
> Thanks in advance,
> Hegg

Backups with filename macros

Greetings, I think this should have a simple answer (whether yes or no)
I would like to make backups to a file in which the filename contains the day of the week. I would assume I could use %d or something like that to do macro substition for the current DOW
Here is what I am doing (so that this makes more sense)
Right click on your database, All Tasks --> Backup Database..
In the "Destination" section, I am adding a Disk destination and specifying a filename, such as "db_monday.sqlbackup" and "db_tuesday.sqlbackup", then consequently setting the schedule to backup every Monday, Tuesday, etc. I would like to set the schedule to backup every day, but specify a macro in the filename to substitute the day of the week. I have tried putting in "db_%d.sqlbackup", but the backup then creates a file named exactly that
Is this possible to do? If so, how
Thanks in advance
HeggYou could build some dynamic SQL to do that, something like below.
declare @.cmd varchar(100)
set @.cmd='BACKUP DATABASE YOURDB TO DISK=''C:\temp\DB' +
datename(weekday,getdate()+1) + '.sqlbackup'''
exec (@.cmd)
--
----
----
--
Need SQL Server Examples check out my website at
http://www.geocities.com/sqlserverexamples
"Hegg" <hegg@.netwidedev.com> wrote in message
news:9A9889C3-E278-47B6-90D9-BD1E12BAB623@.microsoft.com...
> Greetings, I think this should have a simple answer (whether yes or no).
> I would like to make backups to a file in which the filename contains the
day of the week. I would assume I could use %d or something like that to do
macro substition for the current DOW.
> Here is what I am doing (so that this makes more sense):
> Right click on your database, All Tasks --> Backup Database...
> In the "Destination" section, I am adding a Disk destination and
specifying a filename, such as "db_monday.sqlbackup" and
"db_tuesday.sqlbackup", then consequently setting the schedule to backup
every Monday, Tuesday, etc. I would like to set the schedule to backup
every day, but specify a macro in the filename to substitute the day of the
week. I have tried putting in "db_%d.sqlbackup", but the backup then
creates a file named exactly that.
> Is this possible to do? If so, how?
> Thanks in advance,
> Hegg|||MiniSQLBackup allows you to use macros for backup type, server, instance and
database names, and the current date time elements, in addition to
generating smaller and encrypted backup files.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"Hegg" <hegg@.netwidedev.com> wrote in message
news:9A9889C3-E278-47B6-90D9-BD1E12BAB623@.microsoft.com...
> Greetings, I think this should have a simple answer (whether yes or no).
> I would like to make backups to a file in which the filename contains the
day of the week. I would assume I could use %d or something like that to do
macro substition for the current DOW.
> Here is what I am doing (so that this makes more sense):
> Right click on your database, All Tasks --> Backup Database...
> In the "Destination" section, I am adding a Disk destination and
specifying a filename, such as "db_monday.sqlbackup" and
"db_tuesday.sqlbackup", then consequently setting the schedule to backup
every Monday, Tuesday, etc. I would like to set the schedule to backup
every day, but specify a macro in the filename to substitute the day of the
week. I have tried putting in "db_%d.sqlbackup", but the backup then
creates a file named exactly that.
> Is this possible to do? If so, how?
> Thanks in advance,
> Hegg

Sunday, February 12, 2012

Backup Transaction Log

What is the proper way to backup a transaction log for a database whose name contains a space. (I.E. DBname = Database Name). I am trying to execute a command, but it does not like the space in the database name. I have also tried wrapping the name in single quotes and parethesis to no avail.What is the proper way to backup a transaction log for a database whose name contains a space. (I.E. DBname = Database Name). I am trying to execute a command, but it does not like the space in the database name. I have also tried wrapping the name in single quotes and parethesis to no avail.

Parenthesis ()? Or square brackets []? Try the square brackets.

Also (not trying to be flippant), try to avoid spaces in db names.

Regards,

hmscott|||Thanks for the fast reply. The square brackets did the trick.