JarrodMadd said:
The requirement I have is to craete the sql statement that lists all the data
in the correct format. That is done. It also staes to place a blank line
between the weeks giving them seperation.
I cannot find anything in the book showing how to perform that. I am
assuming it needs to be placed some where within this statement giving it a
seperation between weeks:
You won't be able to do that within your SQL; even if you did manage
to create some blank rows (it is possible, but it's fiddly...), they
wont appear in the right places as the ORDER BY clause will force all
the 'blank lines' to sort to the top.
As I said, formatting is not something you should try to do within a
query, but it is something that Reports are designed for.
Try changing your query to this:
SELECT DateDiff("ww",'2000-01-01',date_1) AS week_nbr,
format(date_1, 'dddd') AS days_of_week,
format(date_1, 'mmmm dd, yyyy') AS calendar_date
FROM sec1011_calendar_1
WHERE (((weekday([date_1])) IN ('1','7')))
ORDER BY n;
This will add another field in your query showing how many weeks there
are between 1st Jan 2000 and the date in each row.
Now click on the 'Reports', and click 'Create report by using Wizard'.
Use the 'Tables/Queries' list to select your query, then click the
[>>] button to put all the fields on your report. Click 'Next'.
On the next screen, highlight the 'week_nbr' field, and click the [>]
button. This indicates that you want to group your report by the week
number. Click 'Next'.
The next screen allows you pick the sort order. The 'calendar_date'
field will do fine. Click 'Next'.
The next two screens allow you to pick a layout and style for your
report. You can choose, this time! Once you're past them, you can
enter a name for your report, and click 'Finish' to see how it looks.
It's probably a bit fussier than you want: the quickest way to get
that is to design the form - click 'View' then 'Design View' on the
toolbar, then select everything in the 'week_nbr Header' section and
press the delete key. Now click 'View' and 'Layout Preview' and it
should be close to what you originally wanted.
You'll probably want to tidy up the Page Header and Page Footer
sections as well, but I'll leave you to figure that out yourself
(nothing personal: it's just that Ravens v Broncos is about to start!)
I do not see a Reply to line, only a By: line. Are you wanting me to
email you to your address?
No, that's just part of my signature for people who want (or need) to
send me an email. It just indicates that you need to use the address
in the 'Reply-to' header of my post and not the one in the 'From'
header. I wouldn't worry about it
