473,574 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New record every week?

Jen
Is it possible (how) to display a new record every week (or day) from a
recordset?
Jul 28 '06 #1
18 1984

Jen wrote:
Is it possible (how) to display a new record every week (or day) from a
recordset?
Yes. There are a variety of ways that this can be accomplished. If
you describe your requirement in more detail, it will help us narrow
down the options.

--
Mike Brind

Jul 28 '06 #2
Jen
Sorry for giving such bad description.
I have a very simple recordset that fetches data from a similarly very
simple table. The table is named "Medlemsformane r", and has only two
columns: 1: Id (int), 2: Ledare (ntext). The recordset fetches the text in
"Ledare" and presents them like this:

<%sql="select * from Medlemsformaner order by Id desc"%>
<!--#include virtual="/databas/connection.inc" -->
<%do until rst.eof =true%>
<%=rst("Ledare" )%><br>
<br>
<%rst.movenex t
loop%>

The database is sql server 2003.

Jen.
"Mike Brind" <pa*******@hotm ail.comwrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
>
Jen wrote:
>Is it possible (how) to display a new record every week (or day) from a
recordset?

Yes. There are a variety of ways that this can be accomplished. If
you describe your requirement in more detail, it will help us narrow
down the options.

--
Mike Brind

Jul 28 '06 #3
Jen
And still for clearance; these would be shown onlu for a couple of lines
length. On top of this I would need to show one whole record (text in
"formaner") every week so that it would automatically show a different
record every week.

Jen

"Jen" <je*@hoganmail. comwrote in message
news:e6******** ******@TK2MSFTN GP04.phx.gbl...
Sorry for giving such bad description.
I have a very simple recordset that fetches data from a similarly very
simple table. The table is named "Medlemsformane r", and has only two
columns: 1: Id (int), 2: Ledare (ntext). The recordset fetches the text in
"Ledare" and presents them like this:

<%sql="select * from Medlemsformaner order by Id desc"%>
<!--#include virtual="/databas/connection.inc" -->
<%do until rst.eof =true%>
<%=rst("Ledare" )%><br>
<br>
<%rst.movenex t
loop%>

The database is sql server 2003.

Jen.
"Mike Brind" <pa*******@hotm ail.comwrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
>>
Jen wrote:
>>Is it possible (how) to display a new record every week (or day) from a
recordset?

Yes. There are a variety of ways that this can be accomplished. If
you describe your requirement in more detail, it will help us narrow
down the options.

--
Mike Brind


Jul 28 '06 #4

Jen wrote:

<stuff>

Looks like you're better off asking in a SQL Server group. From what
you've posted so far, it appears that your problem can be solved by
GROUPing appropriately.

Jul 28 '06 #5
Jen
Grouping, -how?

"Bobbo" <ro******@gmail .comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
>
Jen wrote:

<stuff>

Looks like you're better off asking in a SQL Server group. From what
you've posted so far, it appears that your problem can be solved by
GROUPing appropriately.

Jul 28 '06 #6
So you only want to select ONE record for display? Why you are using
SELECT * then? If you have 52 (or is it 53?) records (one for each
week) you can add an int column to hold the week number against each
record, then select the one that matches the current week number

<%
weekNo = DatePart("ww", Now)
sql = "SELECT Ledare FROM Medlemsformaner WHERE WeekNoField = " &
WeekNo
Set rs = conn.execute(sq l)
Response.Write rs("Ledare")
rs.Close : Set rs = Nothing
%>

This would be the easiest way as you are guaranteed a unique record for
each week of the year.

--
Mike Brind

Jen wrote:
And still for clearance; these would be shown onlu for a couple of lines
length. On top of this I would need to show one whole record (text in
"formaner") every week so that it would automatically show a different
record every week.

Jen

"Jen" <je*@hoganmail. comwrote in message
news:e6******** ******@TK2MSFTN GP04.phx.gbl...
Sorry for giving such bad description.
I have a very simple recordset that fetches data from a similarly very
simple table. The table is named "Medlemsformane r", and has only two
columns: 1: Id (int), 2: Ledare (ntext). The recordset fetches the text in
"Ledare" and presents them like this:

<%sql="select * from Medlemsformaner order by Id desc"%>
<!--#include virtual="/databas/connection.inc" -->
<%do until rst.eof =true%>
<%=rst("Ledare" )%><br>
<br>
<%rst.movenex t
loop%>

The database is sql server 2003.

Jen.
"Mike Brind" <pa*******@hotm ail.comwrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
>
Jen wrote:
Is it possible (how) to display a new record every week (or day) from a
recordset?

Yes. There are a variety of ways that this can be accomplished. If
you describe your requirement in more detail, it will help us narrow
down the options.

--
Mike Brind
Jul 28 '06 #7
Jen
No, I don't have 52 (or 53) records. I don't even know the amount of records
that the table will hold. It should simply cykle through the records,
showing a new record every week. If there are 20 records then the cykle
should start over after 20 weeks.

Jen.

"Mike Brind" <pa*******@hotm ail.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
So you only want to select ONE record for display? Why you are using
SELECT * then? If you have 52 (or is it 53?) records (one for each
week) you can add an int column to hold the week number against each
record, then select the one that matches the current week number

<%
weekNo = DatePart("ww", Now)
sql = "SELECT Ledare FROM Medlemsformaner WHERE WeekNoField = " &
WeekNo
Set rs = conn.execute(sq l)
Response.Write rs("Ledare")
rs.Close : Set rs = Nothing
%>

This would be the easiest way as you are guaranteed a unique record for
each week of the year.

--
Mike Brind

Jul 28 '06 #8
Jen wrote:
If there are 20 records then the cykle
should start over after 20 weeks.
I misunderstood, sorry! I thought your aim was one record per unit
(day/week/month) of data. Perhaps I should take some tips from the
'learning to read' newsgroup?

It sounds more like you're doing a Story of the Week type thing.

Maybe you should consider a scheduled script which moves an indicator
through a table of records? In your case of 20 records, you might have
a scheduled script which runs at, say, midnight on Monday morning, that
changes the 'used' flag for the current row. In week one, no records
would have the 'used' flag set. In week three, the first two records
would have the flag set.

This involves adding a bit column to the table and selecting only rows
which have the flag clear (0), with TOP 1 and ORDER clauses to restrict
the dataset accordingly. At the end of the cycle (i.e. no rows
returned) you'd need to clear all the flags.

Jul 28 '06 #9
As Mike says, you need a way to identify the record that needs to be
displayed. Add a column to your table to store an identifier. Perhaps a week
number, or perhaps the first date the record needs to be displayed. Then use
a WHERE clause in your query to retrieve only the appropriate record.

Jen wrote:
No, I don't have 52 (or 53) records. I don't even know the amount of
records that the table will hold. It should simply cykle through the
records, showing a new record every week. If there are 20 records
then the cykle should start over after 20 weeks.

Jen.

"Mike Brind" <pa*******@hotm ail.comwrote in message
news:11******** **************@ i42g2000cwa.goo glegroups.com.. .
>So you only want to select ONE record for display? Why you are using
SELECT * then? If you have 52 (or is it 53?) records (one for each
week) you can add an int column to hold the week number against each
record, then select the one that matches the current week number

<%
weekNo = DatePart("ww", Now)
sql = "SELECT Ledare FROM Medlemsformaner WHERE WeekNoField = " &
WeekNo
Set rs = conn.execute(sq l)
Response.Wri te rs("Ledare")
rs.Close : Set rs = Nothing
%>

This would be the easiest way as you are guaranteed a unique record
for each week of the year.

--
Mike Brind
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 28 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3325
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example I'm adding a customer. The Customer fields are mostly foreign keys that refer to primary keys in other tables, left join instead of junction tables...
17
2060
by: perryche | last post by:
I have 5records, e.g. Rc1, Rc2, Rc3..., when user open up a form, I want it to open to a particular record (say Rc3) then when user chooses the Record Selector , it will go to Rc2 and , it will go to Rc4. If I use Sort in the query, it is sorted alphabetically; if I do not sort, whatever is the latest record will be on top. Any...
6
2766
by: Hans | last post by:
Hello, I want to put logging functionality in my application and i want to store this information in an XML file with date, string and integer values. How do i write just one record to the XML file. I don't want to use a dataset and i don't wan to load the entire file into memory.
4
2723
by: is49460 | last post by:
Any help would be very appreciated!!! I have two tables: Main Data and Archived Data. Each table has the same fields (about 50 or so fields). Main data contains records that are updated every week. Archived data contains historical data that once was in "main data". Each record can be distinguished by 3 different fields (There is no...
5
1689
by: littlevikinggirl | last post by:
Hi, I posted a badly worded question last week so got no replies and am still struggling to figure out the problem myself. I have a table containing two fields, Location and Serial Number. I want to display some of the serial number values on a form which will have a diagram overlaid (to map out the "locations"). I have been trying to...
1
2188
by: Matt | last post by:
I have table that has the following fields: JobNumber WeekEndingDate ReportRequired_01 ReportRequired_02 every Friday morning the weekending date changes. I need to automatically generate a new record for each record that has a job number and weekending date for the new weekending date.
4
4697
by: ringer | last post by:
I have a db where each record is a certain task to be done. Each record includes the date the task should be completed. Some of the tasks are one time only but some are recurring. I have been having to create a new record for every task even the recurring ones, but I'd like to try to automate creation of the recurring tasks. What I'm trying to...
4
2387
by: corey11 | last post by:
I'm a very low-level developer with limited VB knowledge but nonetheless was able to put together a very user-friendly and extremely helpful Access 97 database for my company some 10 years back. We use the database for inventory, job costing, employee records, timecard recording, nearly everything except the hard core accounting. The database is...
0
1985
by: Andy_Khosravi | last post by:
I'm having issues with updates being blocked due to some sort of record locking issue. The error does not occur consistently, so I've had a hard time nailing it down. It does happen enough to cause major problems for my users though as they are working in this all day. I've been pounding my head against the wall for the last week trying to get...
0
7730
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8241
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5624
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5301
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3742
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2249
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1061
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.