Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I NEED SOME HINTS

Status
Not open for further replies.

SHARKY99

Programmer
Oct 25, 2001
473
CA
Ok first i get the curent date and search(one week at a time) for records in the curent week to display them.

My problem is the database only have dates containing info.
How can i skip one(empty) day to display the next filled one???

Here's an example:

On the database:

2001-11-11 Call Bob
2001-11-13 Call For Pizza
and so on....

I get todays date 2001-11-14
then search from 2001-11-11 to 2001-11-17 (curent week)

i'll then display

2001-11-11 2001-11-12 2001-11-13 2001-11-14
Call Bob (nothing) Call For Pizza (nothing)

But how can i detect if the 2001-11-12 is empty???

And skip it to write on the next day(if <> empty)


Thanks in advance...

Sharky99 >:):O>
 
But it's not empty -- it's simply not there, so you just need to compare what column you're currently on (2001-11-12) against what the current record in your recordset is, and if it matches, print the value and moveNext, and if it's not the same, just print nothing, and go to the next column, check again, etc....
penny.gif
penny.gif
 
Ok thanks link9 but when i write my dates on the document where should i get it???

should i start from My_Sunday date and, with a loop DateAdd(&quot;D&quot;,+1,My_Sunday) it one day at a time for the week???? so i got some to compare the results with???

Sharky99 >:):O>
 
I would like to know if it will work?? (see my last post)

Thanks in advance

Sharky99 >:):O>
 
Sounds perfectly reasonable to me -- just pick a start date and go with it.
penny.gif
penny.gif
 
Thanks link9 , one more question what's wrong with this:

Code:
for awind = 0 to 6
AllWeek(awind)=DaybyDay
DaybyDay=DateAdd(&quot;D&quot;, +1, DaybyDay)
next

I want to give 7 values to DayByDay is it good???

Thank in advance...

Sharky99 >:):O>
 
If you have initialized the value of dayByDay before you enter the loop to the date you want to start with, and then plan to use that array for keeping up with your output, then yes, it looks just fine.

One note, the +1 is unnecessary. 1 will do just fine. You only need to specify the sign of a number if your negating it.

:)
penny.gif
penny.gif
 
Thanks but i choosed an alternative to the Array


Code:
TabloOut=Array(&quot;flSun&quot;,&quot;flMon&quot;,&quot;flTue&quot;,&quot;flWed&quot;,&quot;flThu&quot;,&quot;flFri&quot;,&quot;flSat&quot;)
while DayByDay <> rsHorCou(&quot;Date&quot;)
DaybyDay=DateAdd(&quot;D&quot;, +1, DaybyDay)
toind=toind+1
wend

While (my_date) is dif than the one in my db i add a day and i change my day to display(TabloOut)
That's it

Looked hard but i relaxed and looked at it closely and voila...got thru

Thanks 4 the help link9

Sharky99 >:):O>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top