Create Monthly Totals Based On Date Field

my question is regarding using ASP to loop through the results of a sql query and calculate a monthly total based on a date field.

I am using the following query to total the number of train rides for a given branch by day type (weekday, Sat., Sun.) and create a 3 month rolling avg. (to diminish large fluctuations in the data). I am using Oracle 9i to store the data.

Please see below for the database query, the query output, and the desired output using ASP to sum the rides for each month. Code:

View Replies


ADVERTISEMENT

Fill Field Based On Another Field

I have a input form with 5 fields. One of the fields is MajorNo and the other is named Description.

I have a reference table in my MS Access database (tblMajor)that lists the major numbers and their descriptions.

I would like to have the description field in my ASP automatically filled based on the major number entered on the form, so the user will only need to input the major number when submitting to the Access table (tblSalesTotal).

View Replies View Related

Have To Create Hyperlinks Dynamically Based On The Values From Database.

I have certain Keywords stored in a table of the Database.All i need is when ever i find the Keyword in the webpage i need to have a link which opens up as a seperate page and give me the detail information from the database for the seleted keyword.

View Replies View Related

Autofill Field Based On Entry In Another

have form on asp page with an email address field, when the user enters
their email address I want it to populate another field automatically on the
same page, some kind of OnBlur event. Have worked extensively with dropdown
OnChange events but cant get my head around this one.

View Replies View Related

LEFT JOIN On A Date Field And A Numerical Field - Using WHERE Clause

I am using a Relational database for my site and i have the following tables:

FIXTURES, GAMEDATES

the fields in FIXTURES are:

GameDate
Home
Away

(All of the above are numerical fields)

the fields in GAMEDATES are:

DateID(integer)
GameDate(#Date Field#)

What i have done is in the GAMEDATE field in the FIXTURES table i have used the ID number of the date that i wish to assign to that record - using a LEFT JOIN to display the actual date that is pulled from the GAMEDATES table (That which corresponds to the relevant id used in Fixtures)

The problem is that in some of my code i want to display records using sql and sometimes in the where clause i use the following:

WHERE Fixtures.GameDate<=(Date())

obviously meaning WHERE GAMEDATE is LESS THAN or EQUAL to TODAY.

The thing is when i use the join it does not use the where clause and displays all of the records in the FIXTURES table.

Does any one know how to get around this, i have not received any error messages it just isnt displaying the right data

View Replies View Related

Displaying Information Based Off An Empty Field

I've been searching for an answer to this for quite some time now and have found nothing, so maybe (hopefully) someone out there will be able to help me.

At my work, we have a lot of folders for different jobs we've done. And right now, we have more than one person making the folders for all the new jobs that we get. I am trying to make a database were it will only show the jobs that have not had folders made. In order to do this, I've created a field titled "Initials". I want the webpage to pull up all the records where the Initials field is empty, but I'm having trouble doing that. I've tried a few different things and have found no success.

I'm not having a problem accesses the database or updating it, just displaying the right information. I'll give a little illustration (because I'm never good with words):

Say I have 3 jobs: Job #1, Job #2, and Job #3. Someone has already made job folders for Job #1, but Job #2 and Job #3 still need to be made. Since Job #1 has been made, that means there are initials in the initials field of the database and thus, I do not want that Job being displayed on the "To Be Made" page. Job #2 and Job #3 do not have initials in the initials field and as such, I want to display those jobs....

View Replies View Related

Update Field Based On List Selection

What I would like to happen on this page is that when a user selects a company name from a drop down list, his selection autopopulates the cID field based on the selection. The drop down list is getting its choices from the customer table.

As I am still a novice, I am sure there is a way to do it I have not been able to get it right. Code:

View Replies View Related

Returning Records Based On Time Field

How does one return records in a recordset based on a time/date field. If todays date is 8/25/04, how could i return all those records from 8/25/04. Mind you, i have long date format ex. "8/25/2004 4:46:45 pm"

I dont want to user a form for this i simply just want these time- sensative records to be returned in the recordset .

View Replies View Related

How To Hide Form Field Based On Dropdown Choice

Dropdown has three choices. If the third is chosen, the next field needs to be hidden. is there an ASP version of a show/hide script?

View Replies View Related

Change Text Field Based On Menu Selection

ASP/javascript with a drop down populated by an access database. The drop down works fine but I cant figure out how to get it to change a value of a text field.

I want the value in the text field to change to reflect the data in another column in the table, same row. Code:

View Replies View Related

Run Code Once Based On Date + Asp

i was wondering if anyone could tell me how to run code once based on date. I have an application that i want to update a database based on the particular month. Any ideas?

View Replies View Related

Date Based Criteria

i'm looking to select records based on date, the database
stores the date as mm/dd/yyyy time am/pm ie: 08/11/2004 2:42:28 PM and
unfortunately the field is called date

this much I know if i want to select based on date:

select from table where [date]=

it's my understanding that i need to put the name of the date field in
[] in order to prevent it from confusing it with functions etc...
however my problem is this

how do i get it to select records from the month of december i have
tried [date]='12/*/2004' and [date]='::12/*/2004::' and many other
variants that i have read about on various web sites, but it never seems
to work once again the answer is probably not as complicated as i
believe it to be,

View Replies View Related

Problem With An .asp Page Displaying Data Based On A Form Field Value.

I have an asp page that displays informaton from an Access database. I want to create a form that allows users to display only data that matches their search criteria.

I have made many forms like this in Front Page with the Database results wizard, but I want to manually code it. Code:

View Replies View Related

Select Statement Comparing Date() & Date Field Of Database

i'm new here and i'd like to ask if there's someone who knows how to compare date() function and date from database with date/time type inside select statement so i don't have to do if..then..else

View Replies View Related

Search Based On Date Range

I have this simple form that I want to be able to search my database for one field with a date range based on the values from this form, but I am unsure how to write the asp side of how to search the database field for a date between value one and two from a form. Any ideas would be great. Code:

View Replies View Related

Change Image Based On Date

I can use to rotate images based on the date. I have a number of logo images that I want to appear in the same location of my web page. However, I want to determine which one is "active/viewable" depending on the date. I'm somewhat of a noob although I know how to manipulate canned scripts to get them to work. Any scripts out there that do such a thing?

View Replies View Related

Display Records Based On Last_modified Date

I have an access product inventory DB which has a Last_modified field associated with each product. I need an ASP function that will display all records that have been added within the previous week. Aka, SELECT * FROM TBLINVENTORY WHERE .....

The format of the date and time stored is like this: 18/02/2004 6:15:55 PM ...

View Replies View Related

Show Recordset Based On Current Date

I want to call a recordset based on whether the 'expiration_start' date and 'expiration_end' date are within the current date.

I've tried a few things but can't get it to work?

Here's my non-working SQL statement:

Code:

sSQL = "SELECT * FROM poll WHERE #" & date & "# BETWEEN expiration_start AND expiration_end"


I'm simply using 'date' to call the current date. I'm not sure if that's correct but it seems to work ok when I use it in an "if" statement like this example:

View Replies View Related

MS SQL Database Field Date Comparison To Date()

In a connection string, I have the following:

sql3 = "SELECT DISTINCT State FROM Property Where TypeID = '" & srch_cat & "'"

In the database, is a field called expiredDate I am trying to show only records whose expiredDates are greater than todays date, but I am messing up somewhere. The values in the fields are as this: 3/7/03 (or something like that...no time is added to it)

View Replies View Related

Comparing A Date Field To A Date In A Form.

"SELECT id, title FROM Businesses WHERE Date_Added >= " &
Request.Form("Since_Date")

This SQL string returns all records from the table Businesses and does
not seem to be able to recognise Request.Form("Since_Date") as a valid
date. The Since_Date value is entered into a form field as
"01-Jan-2005" and appears to be treated as a date; when viewing the
SQL statement(with a response.write) it shows the date as 1/1/2005
even if it is entered into the form as 2005/1/1

I've also tried CDate(Request.Form("Since_Date")) with no luck,
although this was the treatment that worked when the SQL statement was
running in an .idc file.

Date_Added is a regular DateTime field in an Access 2000 database

Any suggestions please ?????

View Replies View Related

Monthly Archive

what i'm trying to do, is to create table identical to "faults" and move all of last months entries into the new archive table.
the current SQL i have is

SQL = "CREATE TABLE "
SQL = SQL + Left(Date, 2) & ":" & Left(Right(Date, 7), 2) & ":" & Right(Date, 4)
SQL = SQL + " AS(SELECT *"
SQL = SQL + " FROM Faults"
SQL = SQL + " WHERE (((Month([DateAdded]))=Month(Date())-1));"

the error that appears is... "Error 3290 - Syntax Error in CREATE TABLE statement"

can you work out whats wrong?

View Replies View Related

Monthly Drop Down Box

I would like to have a dropdown box that dynamically populate the month and year?

View Replies View Related

Monthly Notifications!

I have a website which has to send e-mail notification to its MEMBERS daily/weekly/monthly!

How do i do it:

1) Use ASP (but it will require a visitor to visit the ASP Page!)

2) Use .exe? (what if i dont have permission on WEBHOST for executing .exes?!)

HOW DOES DEVSHED SEND WEEKLY NOTIFICATIONS.

View Replies View Related

Create Dynamic Hyperlink From Database Field

I would like to create a page of hyperlinks that are constructed from the contents of a database field. When the user clicks the link they are taken to a page that will display all fields from that particular record.

I already have the page structures in place. There are two pages, one with the links and the other to display the record. Code:

View Replies View Related

Grouping And Totals For Group

I am writing a report using ASP and am having trouble displaying the data in the way i want. I'm collecting turnovers for various companies and each of the companies has a county code. e.g. Yorkshire is defined as number 2.

I need to group the companies together by county and need to display a totals line for those members only and then on the following lines I want the next county and its companies.

I can group the counties together but the totals line I'm displaying appears after each companies rather than after the group of companies for a given county.

I use a do while loop to check that there is data in the database for each company. I tried putting the totals line outside the loop and that only shows 1 totals line for ALL companies.

View Replies View Related

Using Shopping Cart Totals

i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code:

View Replies View Related

Getting Totals While Using Repeat Region

I have a database that displays its records on a webpage, The information displayed on the webpage is included in a repeat region so that the related records repeat down the page.

I want to add the totals of the displayed records at the end of the page. How do i do this. Im assuming that it goes outside the repeat region? Does anyone have any code or a walk through of how this is done?

View Replies View Related

Create A Date

I am creating a booking system and need to insert todays date into a DB when a booking is made. I need the date to be in Engliash format i.e DD/MM/YYYY, does anyone know how I can create a date in this format? I think it is something like

dim theDate

theDate = Date()

But this doesn't seem to work for me and it also only displays in US format?

View Replies View Related

Calculating Totals With Data From Access

I have done a fair amount of coding but very little in the way of maths type stuff

<code>
While Not objRSC.EOF
Response.Write "<tr><td>"
Response.Write objRSc("Item_Quantity") & "</td><td>"
Response.Write objRSc("Stock_item") & "</td><td>"
Response.Write objRSc("Stock_description") & "</td><td>"
Response.Write objRSc("Item_Price") & "</td></tr>"
objRSc.MoveNext
Wend
</code>

What I now want to do is to add all the Item_Prices together, .

View Replies View Related

Retrieving Date Field

I am trying to retrieve a date field this is the code

strQ ="SELECT * FROM WaterCompanies ORDER BY WaterCompany"

set objRS=objConn.Execute(strQ)

This is where I am using the date

Response.Write "<TD>"

Reponse.Write objRS("JoinDate")

Response.Write "</TD></TR>"

all the other fields populate so I know I have a good connection.

this is the error



Microsoft VBScript runtime error '800a01a8'

Object required: '' /waterbilling.asp, line 76 <--- this is the response.write objRS("JoinDate") line

View Replies View Related

Format Date Field

i need help formating todays date minus one.
i can get this 1212006 but i need 12012006

View Replies View Related

How To Prepopulate Date Field In Asp With Sql

how to pre populate the date field in an asp form which is using SQL database?

View Replies View Related

Time/Date Field

I have a few date fields on my form. The backend is SQL and the fields are set to smalldatetime. Adding records into these fields is not a problem. This is my code:

if Request.form("ScheduledTrainingDates") = "" then
else
objRS("ScheduledTrainingDates")=Request.form("ScheduledTrainingDates")
end if

The problem is updating the records when I got to edit them. Let's say I have a value in for ScheduledTrainingDates textbox, and I want to clear the value and leave it blank and save it to the database. How do I do this?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved