If The DateDiff Is 24 Hours, Delete Record
I just need to know the DateDiff function for what I need to do...
I will store the date of the database record in a variable called 'sDate' what now? (Also, the format is xx/xx/xx 2:4:56 PM/AM)
I just need to know the DateDiff function for what I need to do...
I will store the date of the database record in a variable called 'sDate' what now? (Also, the format is xx/xx/xx 2:4:56 PM/AM)
I been working on this code for a long time, code doesn't work and It also doesn't show any error. All I am trying to do is delete record. I click on id number from first page that brings me to this page. Code:
View Replies View RelatedI am trying to delete a chosen record out of my Access database using the ID field as the parameter. I can get the script to output the record so I know it has the record, it just won't delete! Code:
View Replies View RelatedI'm simply trying to check if the categoryid is currently being used by any catalogue/product items.
Ok, I've created a mini site content management system and I'm stuck on this function that will ensure data integrity...
I'm trying to check if the categoryid I'm trying to delete has any related 'catalogue' items (products); and if so display a message 'Sorry, there are items currently listed under this category. Move the items before trying to delete'. Basically disallow the delete function if any catalogue items share the categoryid. That's it! Simple... right???
Code:
I have news type thing on my website that displays news items that are entered using a simple html form. they go to a database (real simple so far)I also have an edit form where it loads up the entries from the database onto html forms and you can edit them and then click submit and it applies the changes to the sql database.
simple as well.one thing I can't figure out is how to add a delete button or a delete checkmark so that I can go and delete the entry out of the Database?
I have a microsoft sql database and some tables. One table of them has some dealer's requests for giving to them a mastercode for viewing some special prices. The dealer's informations appears to an asp page in a table.
i want to put a button or an link (query string) to delete separately each record. (the primary key is "clientID"). How i can do this. Which is the command?
In our database, we have a table which contains numbered items. Here is what I'm talking about: Code:
VBKey ChargeCount
12 1
12 2
12 3
12 4
19 1
19 2
When we need to delete a particular Charge (From the ChargeCount column), how can I get the remaining charges to be renumbered. For example, if I delete VBKey=12 and ChargeCount=2, how can I make ChargeCounts 3 & 4 turn into 2 & 3? I'm a little lost at making a query for it?
I'm trying to delete a record by ID. When the user clicks on the record they want deleted from website form it should delete this one record only. But I'm getting this error. Code:
View Replies View Relatedhow do you delete data using asp, let's say i have a data listing page and by every record i want to have a delete button ?
View Replies View RelatedI get this weird error when I try to delete a record...
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'Cal_EventID ='.
/calendar.asp, line 1596
Here is this code on line 1596.
Code:
SQL = "SELECT * FROM Cal_Events WHERE Cal_EventID = " & SafeSQL(request.querystring("eventid"))
Set RS=dbc.execute(SQL)
I have written an events diary for a client .. and they wish to have a system of multiple deletes so they simply use a check box to select the items to delete and then hit a button to remove the selected records form the database. as all iget is scripting errors. Is there a simple way to do this?
Someone advised me to use an IN statement to Delete multiple records, but all I get is :
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID In ()'.
I have followed several different tutorials but I get the same outcome! It doesn't seem to like the IN statement.... any ideas anyone ???
im trying to add the delete record behaviour with dreamweaver. iv set up all the text fields and the recordsets but when the behaviour is generated the error "the original recordset in the script was not found". i have the add record server behaviour working, but this is not .
View Replies View Relatedi have found various example scripts to add/edit from database, but how can i show all the db records by id on a page, then have a form with a box to choose which record to edit/delete by id, and then when chosen, it shows the info for the record in a form, which then can be just edited and updated?
I want it to be just like as if you had just typed the details into the form itself before you registered.
I'm trying to build a web page that will automatically delete records (in Access 2k) after a certain amount of time. I need to delete records that are older than a month of the current date.
I've searched all over the internet trying to find examples of how to do this and the few that I've found don't seem to work for me. Does anyone have an example that works? Either using an sql query or programmatically. I'm using Classic ASP (VBScript).
Im trying to setup a delete record thing and it keeps telling me before using this server behavior please create a record set. However I already have a recordset on that page named rsDelete.
View Replies View RelatedI have a search page ( below is some of the code). I am currently displaying records from my Access database. At the end of each row, I am printing out a delete.gif. On click of this image I would like to Delete the printed record. How do I do this? Can you point me in the right direction? Code:
View Replies View Relatedi'm importing a date ( 13/2/2005 1:20:22 PM) from SQL server
to informix.
The problem now is informix doesnt accept alphabet in datetime format,
so i plan to convert it before the date insert into informix db.
But the problem is i dont know any function that can convert the date time
from 12 hours format to 24 hours format.
I need to convert number into hours..Example: 12.60 should be 13 hrs,etc.
My variables
Total = oRs0("Tot") + oRs1("Tot1")
I need to get average of the hours after (start_date - end_date). *start_date and end_date is in format 'mm/dd/yyyy hh:mi:ss am' . Is there any function in oracle that i can use so that i can directly get the average of the hours in SQL statement?
View Replies View RelatedHow can I subtract hours from 'Now()'?
I can subtract a day, but that's by only having ONE integer...what do I do for hours? (i need this because our server uses EST and clients need their TimeZone)
how you convert an integer such as 5 into an hour string so the system identifies it as an hour instead of just the number 5 and then once you do that ("if you need to do that at all") add 5 hours to the current time...
Also is there a way way to add lets say 50 hours to our current time and date so when it is calculated it shows 2 days and 2 hours away from now... If you cant do that it would be nice to know how to change 7.85 into just 7... or 8.94 into just 8... no rounding up or down just the first number before the decimal.
I am using a select sum(tot_daily) as total hours ...it calculates the time incorretly...
Example:
ID | Tot_hrs | Person
----------------------
1 5.45 A
2 5.45 A
3 5.45 A
The total hours should be 17 hours 15 mins...but the result comes as 16.35.... Is there a way to calculate it as 17.15 in db level in a select statement
How would I write in SQL or ASP the following?:
Count number of Database Records between NOW and 24 HOURS EARLIER? I know
how to retrieve recordsets etc - its just the date thing I cant grasp. I am
stuck getting the 24 hours earlier data capture.
I have a request from the boss to make a report that will require me to display how many hours something has been in a particular state. (As in status). Hard to explain. Anyway, I need to go to the table in the db, find all rows for a particular trouble ticket, find when they were put into one of our 7 statuses, when they were put into another status (this info is already in those rows), then determine how many hours they spent there in
each status.
So a ticket report will say that ticket 1000 spent 4 hours in customer research, 5 hrs in our company coding. 3 in our company testing, 4 in customer testing, etc.
The thing is, It has to assume an 8-5 workday, and leave out any hours which don't fall in between 8 am to 5 pm, and also rule out any weekends.
I have two Win2K machines. Both "appear" to have been set up identically.
They both reckon that they're using UK date format.
However, if I create the following ASP code:
<%
Response.Write Now
%>
One returns
16/01/2004 17:12:19
Which is what I want, whilst the other returns:
1/16/2004 5:15:21 PM
Here, the day and month have been transposed and the time appears in the 12 hour clock format.
I'm trying to write a script to countdown the number of hours and minutes until tomorrow. So far, this is what I have:
Code:
<%
response.write(dateDiff("h",now(),date+1)) & " hours and " & dateDiff("m",Time(),date+1) & " Minutes "
%>
The code above correctly displays the hours until tomorrow. but it's not displaying the minutes correctly. It's displaying the total minutes until tomorrow. If there at 4 hours left until tomorrow it's saying "4 Hours and 240 minutes."
I need it to display "4 hours and 0 minutes."
I am trying to replicate the Ebay Time Left on Auction.
1 Day, 1 hour, 12 minutes.
I would like to calculate this from the current time and date. How do I get
this result?
Code:
Set rs = objconn.Execute ("SELECT * FROM members WHERE UserID =" & UserID )
iMinute = DateDiff("n", Now, rs("LastLogin")) 'Find amount of minutes...
iHour = DateDiff("h", Now, rs("LastLogin")) 'Find the amount of hours...
iDay = DateDiff("d", Now, rs("LastLogin")) 'Find the amount of days...
iMonth = DateDiff("m", Now, rs("LastLogin")) 'Find the amount of months...
response.Write(iMinute)
response.End()
is this correct? is doesn't look right what is brings back
I face that problems
07/01/2003 06/30/2006 ---------> it should be 3
01/01/2003 02/28/2005 --------->could i get 2 years and 2 months
01/01/2003 03/01/2005 --------->could i get 2 years and 2 months and 1
day
I am trying to replicate the Ebay Time Left on Auction. 1 Day, 1 hour, 12 minutes. I would like to calculate this from the current time and date. How do I get this result?
View Replies View RelatedBeen playing with the function DateDiff, and with it it's easy to calculate the difference in years/months/days between two dates. However, if i wanted to calculate the difference in Years, Months, Days, Hours, Seconds (a la Ebay bids) how can I do this? Is it easy or complicated?
View Replies View RelatedIve got some code on my site that shows how current the database is. Basically it looks at fixed text file that I am basing the database on, checks to see iwhen it was created, then displays the time.
My webserver must be on the East Coast and I am on the West Coast, so the time the stamped file time is 3 hours ahead. Code:
I'm creating a Help Desk Call Track System... one of the fields we want to store is the length of time the call was "Open." When the call is logged, the Now function is used to pull the date in vbGeneralDate format. When the call is closed, Now is again used to pull the date in the same format.
Our current system uses hours to track calls
To give an example of what is making it to the database...
BeginDate = 2/5/2004 2:19:40 PM
EndDate = 2/5/2004 2:20:09 PM
Then I do this calculation...
Duration = DateDiff("h",BeginDate,EndDate)
The value stored in the database is...
Duration = 14
I'm assuming that it is reading back to 12:00 AM and counting the hours up till 2:00 PM. I'd like to be able to do fractions of hours (displayed in decimals).