I'm new to this Forum and to Microsoft Access, so that being said I'm sure this is an easy fix.
I am making a database for my unit and I am stuck on my gains loss reports. I've tried using the code below but, i only get results that are within 30 days but the year doesn't matter. I need the results to take in to cout the year also. for example:
right now I put in the code looking for dates of loss with in the next 30 days, my results would enclude:
29 Jan 1985
03 Feb 2007
12 Feb 2002
where all i want is to show the dates in the next 30 days: 03 Feb 2007
eventually I want to have reports that will do 30, 60, 90, 120 days till loss. but I should be able to figure it out if you help me with the 30 days.
heres the code i am working with. thanks in advance for your help. - ((([DEROS]+((Int((Now()-[DEROS])/365.25)+1)*365.25)) Between Now() And Now()+30))
10 1689
Hi, take a look at DateDiff()
ADezii 8,834
Recognized Expert Expert
I'm new to this Forum and to Microsoft Access, so that being said I'm sure this is an easy fix.
I am making a database for my unit and I am stuck on my gains loss reports. I've tried using the code below but, i only get results that are within 30 days but the year doesn't matter. I need the results to take in to cout the year also. for example:
right now I put in the code looking for dates of loss with in the next 30 days, my results would enclude:
29 Jan 1985
03 Feb 2007
12 Feb 2002
where all i want is to show the dates in the next 30 days: 03 Feb 2007
eventually I want to have reports that will do 30, 60, 90, 120 days till loss. but I should be able to figure it out if you help me with the 30 days.
heres the code i am working with. thanks in advance for your help. - ((([DEROS]+((Int((Now()-[DEROS])/365.25)+1)*365.25)) Between Now() And Now()+30))
The Year doesn't matter because your Date Field is probably defined as Text rather than Date/Time. Make the Data Type conversion, and you should be OK.
I looked at DATEDIFF and am still having some trouble. Actually think I confused myself more. thanks for the help though. :)
The Year doesn't matter because your Date Field is probably defined as Text rather than Date/Time. Make the Data Type conversion, and you should be OK.
The date Field is defined as Date/Time, and it is still giving me the same results.
NeoPa 32,579
Recognized Expert Moderator MVP
Two suggestions : - Use Date() rather than Now() for predictable results.
- Take the code you use to determine the date (It refers to various items not explained here so don't expect us to understand what you're trying to do) and put it in a SELECT statement.
See what format it comes out in. Is it a Date/Time value or a string or maybe even a numeric.
When this is sorted out you'll be in a better position to use it properly.
Two suggestions :- Use Date() rather than Now() for predictable results.
- Take the code you use to determine the date (It refers to various items not explained here so don't expect us to understand what you're trying to do) and put it in a SELECT statement.
See what format it comes out in. Is it a Date/Time value or a string or maybe even a numeric.
When this is sorted out you'll be in a better position to use it properly.
I guess this just goes to show I'm in over my head with this. I was using the above code to find birthdays comming up in the next 30days, but now i need to show dates of events in the future. so like if i wanted to see upcomming appointments with in the next 30 days it would show that.
Thank you everyone for your help, I think I still have a lot to learn so that I can help you help me, right now I just don't know what I'm doing.
Thanks,
gordy
Thank you to everyone who has been tring to help me, I've actually figured it out. just had to change Now() to Date() and changed *365.25 to /365.25 and that fixed it. heres the finle code for anyone who may want to use it down the road. - ((([DEROS]+((Int((Date()-[DEROS])/365.25)+1)/365.25)) Between Date() And Date()+30))
NeoPa 32,579
Recognized Expert Moderator MVP
Thanks for posting that Gordy.
It's always good to have a resolution post and I'm pleased you got it sorted out :)
I guess [DEROS] is your table's date field.
Thanks for posting that Gordy.
It's always good to have a resolution post and I'm pleased you got it sorted out :)
I guess [DEROS] is your table's date field.
Yes, sorry about that not telling everyone that.. DEROS is a millitary term. for date of loss. so I can keep track of when my soldiers are getting close to time to leave. thanks for the help!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: smilemaster |
last post by:
I have recently started experiencing form data loss. Here is an
example:
====test_form1.php====
<form method="POST" action="test_form2.php">
<input name="textboxvalue" type="text" size="20">
<br>
<input type="submit" value="Submit">
</form>
|
by: Nicola |
last post by:
Hi Everyone,
I am new to programming and would like to know how to
open an access Report from within vb 6. I am trying to write a program
to organise cross stitch threads. I have found out how to use a database
table
but all I want to do now is to click a command button to display this access
report.
Any suggestions please ?????
|
by: Nathan Bloomfield |
last post by:
Does anyone know if there is any documentation which relates to Access2k + ?
or can anyone help adjust the code?
I am having trouble converting the DAO references.
TITLE :INF: How to Create a Dynamic Crosstab Report
PRODUCT :Microsoft Access
PROD/VER:1.00 1.10
OPER/SYS:WINDOWS
|
by: sid |
last post by:
Data loss in Access-97 from VB 6.0
I have encountered Random data loss in our access database.
Sometimes the users call in saying that the records entered by them
are lost. The users, use our VB front end to enter the data (Users do
not enter data directly into the database)
Most of the times I have noticed that the problem occurs when users
add new records.
All our tables have a unique alpha-numeric primary key.
|
by: Neil Ginsberg |
last post by:
I'm having some problems with an Access 2000 MDB file with a SQL Server 7
back end, using ODBC linked tables. I previously wrote about this, but am
reposting it with some additional information and in summary form, in hopes
that someone might have an idea about what's going on.
I am using a bound form which is losing data a significant portion of the
time. Basically, the form contains 6 fields and three subforms, as follows:
Field A...
| |
by: Tim |
last post by:
Hi, has anyone experienced a spontaneous loss of a subform bookmark
(i.e. resetting to the first record), when the computer is idle.
I used to have a problem in NT4 when doing a couple of specific things
outside of access (launching internet explorer or adobe) that would
cause a loss of bookmarks within access. Since our migration to XP
though my database seems to do it spontaneously whilst the computer is
idle. I guess its actually...
|
by: Bob Alston |
last post by:
I am looking for Access reporting add-in that would be easy to use by
end users. My key focus is on selection criteria. I am very happy with
the Access report writer capabilities. As far as development of
reports, it is certainly fine in my book.
But for end-users, with little experience or training, it would be nice
to have an easy way to handle various selection criteria, perhaps with
relatively stock reports. I see easy to use by...
|
by: amith.srinivas |
last post by:
Hi all,
From a word macro in VBA, I am trying to create a report in
access DB. The report is based on a query with a parameter. I am using
Set rpt = Application.CreateReport
rpt.RecordSource = <<Query_Name>>
Once I create the report, I m trying to create labels to display the
Report title in the Report Header section.
|
by: chetchet007 |
last post by:
I have a stock table with the cost price and the selling price, then i have an invoice that is produced. i need to produce a profit/loss for either daily, weekly or monthly i want to do this by drop down menu so as soon as e.g. weekly is selected it gives the profit/loss for that week. If there is a loss i wanted the loss to be displayed in red.
I'm totally newto using access i have to use it for my coursework and i need help if you need any...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |