Calling SQL Records In ASP With Different DATETIME Values

I have buil a app that records types of transactions.

Each transaction has a specific type and also a DATETIME value attached.

I can display and work out calculations on all the data but I do not know who to sperate this into doing calculations for the previous days, week, month ext..

This is where I really need your help.

Can you please instruct me in how to do this, what im thinking is where the user can enter or select the days date thay want to look at and then this quiries the informatio where the date is within this critetra. (the same for week or month also)

Another problem for this is how can I have a something on the page which automatically tells it look at yesturday only, how does the computer know what yesturday will be, will the user need to enter yesturdays date in a specific format?

ANY HELP WOULD BE REALLY GREATFUL as I have a short time to put this historic information viewer togther.

View Replies


ADVERTISEMENT

Calling/passing Values To Another Server

I have an asp page that writes to a database after making a sale. This part works fine. In this same asp page, I would like to then call a different server to release a product key. The following is what I need to call: Code:

View Replies View Related

Disappearing Form Values When Calling Subroutine

I am calling a subroutine when I click a submit button. In the subroutine I grab values from text boxes and validate them. If it all works then it goes to the Update page.

Well my validating works but when it calls the Update page I am using the Request.Form to get the values from the form to update/insert into the database.

Well if I do an update it updates all the fields as empty. If I try to do an insert is says it can't insert NULL into the Primary key field.

Now most of the time the Primary key field is a list box and I don't touch it in the subroutine. Still why are all my values disappearing when I call the subroutine??

So I guess that is it. When I validate a forms values, them same values are no longer available on another page through Request.Form?

View Replies View Related

Calculating, Calling & Printing Return Values

I have a problem with returning a value from an external function.....

My asp page is basically a list taken from a database. A date record is written from the DB, then all the recordslinked to that date are listed, then the next date, then the next series of records, i.e. Code:

View Replies View Related

Adding Values From Records

I want to add intQuantity of all records that have the same prodID. I have tried all sort of variations but I don't seem to get it. I would imagine that it must be simple, that's why I can't get it.

SELECT SUM ( intQuantity) AS ItemTotal
FROM tblOrders
WHERE prodID = ? no clue

Or can I do that in ASP? doing something like (my example doen't work)

<%= (rsOrders("intQuantity") + rsOrders("intQuantity")) %>

in the mean time I'll be looking around for an answer to my lack of know how.

View Replies View Related

Count Records With Distinct Values

I have got an access database with 100's of records in it(each record is just one word/phrase)...i am looking to develop some asp code that will select all distinct values in that table and list the number of times that text appears.

For example in the table contains the following records: -

banana
apple
orange
apple
apple
orange
apple

I want the following output: -

apple - 4
orange - 2
banana -1

View Replies View Related

Changing Values In 1 Listbox When Selecting Records In Another Listbox

I was wondering if you could help me with the following problem. I have 2 listboxes in my
webpage, 1 has cities, and the other lists the streets of the city from the first listbox.

When I click on a city, I want the 2nd listbox to populate with all streets in the city. The city and streets are saved in a database, so when the user selects the city, I will run a query on the database and populate the 2nd listbox with all streets.

How can I do this with normal ASP? I know how to do this with ASP.NET, but don't know how to activate this with normal ASP?

View Replies View Related

Datetime SQL If Statement

I am designing a page in ASP and using MSSQL for the database. I want to use an if statement saying that if the field is empty, display something, else display something else.

However when i write:

Code:

If rsBoxEdit.Fields.Item("bFinishTime").Value = "" Then
response.write("Edit Finish Time")
Else
response.write("Finish Time Already has a Value")
End If

It say "Finish Time Already has a Value" when the field is blank.

The database saud the field is <NULL> if this helps and the field type is set to datetime.

Also if i put

Code:

If rsBoxEdit.Fields.Item("bFinishTime").Value <> "" Then
response.write("Edit Finish Time")
Else
response.write("Finish Time Already has a Value")
End If

It STILL says "Finish Time Already has a Value"

If someone could help that would be great....

View Replies View Related

Datetime Conversion

I am calling a recordset from sql which happens to contain one column that is a datetime in the format: DD/MM/YYYY HH:MM:SS. So when I call that column from the db, it displays in the same format within my page.

However, I would like to be able to display the datetime as part of my recordset, but in a more aesthetically pleasing format (i.e: Sunday 1st May 2000, 7.23PM)

I have tried using the formatdatetime() function along with my rs, but this causes syntax errors. I know this is probably dead simple, but I don't get it!

View Replies View Related

Mysql And Datetime

I am using mysql as my database and which to use a datetime field, for both displaying the data and time and using it to sort the recordsets.

And although when you look at the Db it shows the data and time like this

yyyy-mm-dd hh:mm:ss

however if you simply display the field it displays like this

mm/dd/yyyy hh:mm:ss am (or pm)

I want to sort the data out so that it displays dd/mm/yyyy and there is no time, i can do this but wanted to know if there is a better way of doing it

My problems being I first have to work out if the date is below 10 then us a split function according, then the same with the month, then i have to use a massive if statement, to get it to display in words, and then I have to us the queries before so i can split the year, even if i use to fields in the db to store time and date i would still have the same problems, what is the best way to do this, Plus i may have more than one record to do, will this make a big different in processing my page if i say have 20 records to do.

and just to make sure is the timedate field suitable to sort my record sets out.

View Replies View Related

Out-of-range Datetime Value.

Once i inserted "date()" in date field
This worked fine for 3days
but on the 4th day I got this error

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Again I changed the format of date to oracle DB format
and Ive solved the prob

I just want to know why I got that error

View Replies View Related

Datetime Format

In one of my asp webpage,i am fetching the data from a XML file and which indeed is fetching data from mySql database.

Now the date time format i am getting in from XML is "Wednesday, October 24, 2007, 2:03:42 PM" and when i display that time in my asp webpage then it shows like
"Wed, 24 Oct 2007 19:03:42 +0000"

View Replies View Related

Logs The Datetime

I have a shopping cart that logs the datetime when a user logs in...

I want to run reports to see who all has been on in the last 90 minutes (or whatever my script specifies)

The problem is that I cant get the select statement down...

I would think it to be something like:

SELECT CompanyName, LastLoggedIn from LoginDB where LastLoggedIn > (LastLoggedIn -90m)

And obviosuly that doesnt work as the datetime field date is in the format:

1/21/2007 2:20:00 PM

View Replies View Related

Date From DateTime

I'm trying to isolate just the m/d/yyyy part of a datetime string like
below. Can someone tell me why my string modification fails on some dates? I
thought byb basing my code on where the blank space between the date and
time would work. my code works on some dates that are single digit days and
months.

mydate = "12/30/2005 10:00 AM"

newDate = Left(mydate,len(mydate)-Instr(mydate," "))
response.write newDate
' trying the return 12/30/2005

View Replies View Related

Datetime Problem

I have a form that submits the date to SQL database. problem is the date keeps getting messed up, such as:

25/12/05 is in the db as 05/12/2025

I live in the UK hence dd/mm/yy.

I have tried using Code:

<% LCID=2057 %>

at the top of the page but still the same.

View Replies View Related

Search Datetime

what formate does your variable have to be in to search a sql datetime type i am trying mm/dd/year?

View Replies View Related

Datetime To Display

I just want datetime to be displayed as it is displayed in codecomments forum

format is like
mm/dd/yy hh:mm

View Replies View Related

Now() With DateTime Field

I am trying to do an INSERT using the Now() function to populate a MySQL DateTime field. It is giving me the following error:

Incorrect datetime value: ‘11/20/2005 4:56:39 PM’ for Column ‘DateAdded’ at row 1.

The SQL works if I remove the DateAdded part so I assume the SQL statement is good. The reading I have done on MySQL shows examples using the Now() function inserting into different date/time MySQL data types so I don’t understand why my SQL is not working. I am trying to use the DateTime data type… basically, I want to keep as accurate of a date time as possible.....

View Replies View Related

Insert Datetime

This is part of an expense reporting application that I'm trying to recreate for a client. Client logs in and is shown a date. The date shown lets them know that they are entering info for the month after their last report (which is why we can't use Now(). The months have to be entered sequentially.This part is working fine.

I have a hidden field that holds the same date variable that I need inserted back into the same db. When they submit the form, they get a results page telling them everything went through. Everything is being inserted correctly to the database except for the datetime. It gets inserted incorrectly like this 0000-00-00 00:00:00. Meaning, it's zeroed out everytime even though the hidden field is pulling the date correctly.

View Replies View Related

Datetime Timestamp

how can i only display the hour / minute portion when i do (timestamp2 - timestamp1) in asp. When i display in asp, it gives me some funky number, probably it is the representation of timestamp value. It works in query analyzer, it gives me some date but the time is write though.

View Replies View Related

Subtract One Datetime From Another

need to subtract one date from another to show how long a user was logger in for. i.e.

<%=(rsDriverLogin.Fields.Item("OFF_DATE").Value)%> minus
<%=(rsDriverLogin.Fields.Item("ON_DATE").Value)%>

The values in the sql OFF_DATE and ON_DATE fields are stored as 13/06/2006 19:01:28 . Can either be done on the ASP page or in the db itself, doesn't matter which.

View Replies View Related

Formatting DateTime

I have a client who does not like the uppercase PM AM that is passed from MS SQL I would like to format that to am pm lower case. my code is Code:

<%= " " & TimeValue(rsDT("StartDT")) & " - " & TimeValue(rsDT("EndDT"))%>

this returns

1:00:00 AM - 1:00:00 PM

View Replies View Related

Datetime Function

I am trying to use the datetime function. I am using Access as my backend database if you are wondering. I am building a program where someone can keep track of the software in our department and she wanted it to be able to email her when the software has been checked out for over 7 days.
How to do this or where I begin? I am not too familiar with how one would add to dates in ASP.

View Replies View Related

Datetime Question

i want to query the datetime field. need some guidance. Intention is to "Select * ...... Where datetime > 1st Jan 2006 and datetime < 31st Jan 2006" . My datetime is in "mm/dd/yyyy HH:MI: SS" . i understand that i can't put the query as in "where datetime => '01/01/2006' and datetime <= '01/31/2006'

i need to convert it to varchar as in "where convert(datetime, convert(varchar(10)...". Am i right ? Any other way to achieve that? What will be the correct query ?

View Replies View Related

Datetime With Access

I am trying to use the datetime function. I am using Access as my backend database if you are wondering. I am building a program where someone can keep track of the software in our department and she wanted it to be able to email her when the software has been checked out for over 7 days. how to do this or where I begin? I am not too familiar with how one would add to dates in ASP.

View Replies View Related

CAST Int To Datetime

I have a date/time field, and I have an int field. When the user submits the form, I want to do date/time field - int field. I want to CAST the int field to a hour / minute field. Is that possible? For example: (4/7/2006 12:13:15 PM - x/x/xxxx xx:15 (min):xx
Is there a better way to do this besides this?

View Replies View Related

Convert DateTime

now() returns server time of : Code:

12/3/2004 10:15:21 AM

I need to convert it to return the datetime without " AM" or " PM".

View Replies View Related

DateTime Insert From String

I have a form that collects the date and time of an event.

I create a string to hold all of the data in the correct format for MySQL and it (the string) looks like this...

2007-03-03 17:30:00

I am then using CDate to convert the string to a DateTime type.

and since I am in the US it gets converted like this...

3/3/2007 5:30:00 PM

per my regional system settings...

I grabbed this code from the forums here which I have used before...


Function ISODate( dt )
If Not IsDate( dt ) Then
ISODate = "NULL"
Else
dt = CDate( dt ) ' safety
ISODate = "'" & Year(dt) & "-" & Month(t) & "-" & Day(dt) & "'"
End If
End Function


ISODate = "'" & Year(dt) & "-" & Right("0" & Month(t),2) & "-" & Right("0" & Day(dt),2) & "'"

My question is How do I modify it to add the time to the ISODate function and then include it in my insert statement correctly?

View Replies View Related

Retrieve Systems DateTime

I am developing a website which run on the server and i want to make a database having date and time of the client machine. How it is possible in ASP, VB Script.

View Replies View Related

Strip Time From Datetime

I have a field with datetime values like below LISTING 1. me write code strip the time part so only values like "7/15/2005" will be left.

Note - We must be able to strip dates with double digit months and days, so
i can't just use the right function with a hard coded parameter. Code:

View Replies View Related

Querying A DateTime Field In An SQL DB Using ASP

I have a small (still) SQL database, which I am trying to query from an ASP
page.

The field I am querying is of DATETIME data type, and is populated
automatically using the GetDate() function as a default value.

When I try and search on this field, using a date/time in the format
dd/mm/yyyy hh:mm:ss as the search criteria, it fails with the following
error:

[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data
type to a datetime data type resulted in an out-of-range datetime value.

Can anyone tell me why this is? Surely if I am passing a value in the
correct format for the data stored in the field it should work? Or am I
missing something.

View Replies View Related

DateTime In Paramtized Asp Query?

How does one paramtized a date in asp for a stored procedure that is expecting DateTime? Code:

View Replies View Related

Text Changes Colour/datetime

I have a form which I'm trying to get the writing to change colour after 48 hours and then 336 hours. Fields that need to change:

InstallationDate - compare the SignedDate with the InstallationDate. If the InstallationDate is older than 48 hours then the text needs to change to red. InstallComplete - compare the SignedDate with the InstallComplete field. If the InstallComplete field is still not filled [null] after 48 hours of the signed date then the text needs to change to red.

View Replies View Related







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