Comparing Database Fields
how to compare one Database field against another which both have a date and time in them (DateTime format) using VB in WebMatrix. or just comparing Database fields of DateTime aginst each other in VB.
View Replieshow to compare one Database field against another which both have a date and time in them (DateTime format) using VB in WebMatrix. or just comparing Database fields of DateTime aginst each other in VB.
View RepliesIs there a way to do the following select (like in Dlookup?)
SELECT Permit_No FROM Table1 WHERE Table1.Address like Table2.Address
I want to get Permit_No from table1, but its WHERE condition depends on comparing two address fields in different tables. Will that work?
I have a simple html/asp form that submits data to an access DB. The idea is when calling a record back from the db, the page will have an option to change certain fields (drop down) then a new submit option. My question at this point would be what logic or commands would I use to compare the original data in the fields to what's being submitted.
I ultimately want to preserve the original records and somehow append data that changes only. I'll need to eventually call a record and see all the changes/updates made. Someone mentioned I would prob need a couple of tables with a link (relationship) but is it possible to dynamically create fields as changes are made?
I have two variables
DIM medical_crew_1
DIM crew_name
One was created by joining the results of a database query
'first connect and query the first database table ........
objRS("first_name")
objRS("last_name")
crew_name = objRS("first_name") & " " & objRS("last_name)
I am comparing this variable with the second variable which comes from a
seperate table in the same database Code:
I use a simple page to list the contents of a directory and include a form to allow a user to delete items from the directory.
I now need to compare the contents of a directory with a field in a database to see if the file/image in the directory has a corresponding entry in the database. I would like the file name of any items that do not match written to the page in red so they can be deleted. Code:
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 RelatedI am looking for an ASP script that let me to serach all database contents with only one textfield in search page. eg: I have a database with five columns for lessons: Mat, physics, geography, history and sport. Each field have numbers 1 thr 5. I want to search only those students have number eg:3. with entering the number in textfield in serach page. I have no problem in result page.
View Replies View RelatedIs their a way to check with asp-code if a database field is relational with another field (from another table)?
For example:
If fieldname = relational Then...
End If
I'm trying to set up a quick if/then/else statement for when the database field returns no results. I'm not getting an error but when the field is EMPTY it still executes the ELSE statement.
<%
If rsOffice("FloorPlan") = Empty Then
Response.Write ("Not Available")
Else
Response.Write ("<a href=" _
& rsOffice("FloorPlan") _
& ">View</a>")
End If
%>
At the moment in time I have a product database being displayed. I could do with including another column to the database which allows me to enter a specific quantity for that product line. All the quantitys fields need to be calculated to their specific product cost value.
Finally all the sub totals need to be calculated together to give a grand total, which will be displayed on another page.
i have a form with fields that contain data from a db. the fields can then be edited, and on the click of the "submit" button, the updated information is returned to the database, replacing the old. a bonus would be arrow buttons allowing navigation from one record to the next, with the information populating the form each time. i'm having a hard time with this.
View Replies View RelatedI'm trying to retrieve information from a field in a database, which contains data, some of which are the same. ex:
let's say the table is called "Person_info" and there are 5 rows of info with a different person's info.
let's say i want to display the info in the fields called "City" but there are duplicates ex:
Toronto
Vancouver
Toronto
New York
Atlanta
I'd like it to display all the cities in there on a web page, but, I don't want it to display the same city twice:
so it'll display this:
Toronto
Vancouver
New York
Atlanta
I just can't get it to work? it keeps displaying duplicates.
This code has worked in the past on this same page, and for some reason it doesn't want to calculate the numbers anymore. Anyone see anything that is out of whack?
Basically I am taking the input numbers for each field and adding them up on one column, then taking the totals of all of those columns and adding it up to display as an overall total. Code:
How can I specify formatting restrictions for special fields like Postal Code
(format X1X 2C2) or date input field MM/DD/YYYY? I have Acces DB with these specs, but when I used FP2002 Database Interface Wizard, it ignores these. Also I am unable to "edit" any of the records utilizing pages generated by this wizard.
There is an error that it will not accept empty fields. I have no problem adding data (even if some fields are empty) or deleting records.
I am using a repeated field to bring in to my page repeated records, and I have been able to retrieve values that are entered into text boxes that are associated with these repeated fields. I would like to post these values into a database, but I'm not sure how to set up my table as I know that each employee's values as well as number of fields will be different.
I thought about setting up two tables. One that houses the dynamic question and the other to house the answers, but I'm not sure if that will work. I could really use help as to the syntax to write a loop statement that will insert my returned variables and create the field names dynamically into my database table. I believe this is what i need to do.
I have a an issue that I would love to solve. The below code adds 111111111111111111 to the field when I want it to sum the amount which in this case totals 18 and then add that total (18) to the field! Code:
View Replies View RelatedI am currently working on a document management system for my company's Marketing department. They wish to be able to upload files to the server.
Rather than deal with the many permissions issues we have had in the past with saving and deleting these files to the server's file system, this time we are trying to use SQL server BLOB fields to store the files.
The premise is simple -- a user clicks on the link and the file is then shown in the browser. The documents are mostly word, Quark, and Adobe Illustrator documents. I was thinking the code would go something like this: Code:
I have announcements down the left hand column of a site and want to display contact info if it is available - if it is entered into the database. So I only want to display a space plus the data if there is data in the field. Code:
View Replies View RelatedI don't know how to upload word doc, images and other files into Oracle Blob fields with binary format.
I tried with the following code, normally it's inserting, suppose if i try to convery binary. Code:
im trying to build a custom webBlog interface with asp language and javascript embedded htmleditor. im using htmlTextArea to permit user to edit html code onthe fly (with IE 6+)
the address to the current site is URL you can check out the admin interface by clicking on login and validating with pass***
you can try editing an existing record in the first table (you click on the [...]to open the table) Code:
I have an array, let's say: a(test1, test2, test3). test1 = 1, test2 = 3, test3 = 4.
I have a for loop:
for z= 0 to 2
if a(z) > 0 then (what I am trying to do is if test1 > 0 then do ...)
somecode
end if;
next
Could anyone let me what is wrong with my if statement? The code inside the if statement does not executed.
let.... the strings are
a="234.5;678.3 "
b="678.3 "
on comparing this two i want to get 0 if the b value dosnt exist in a must return 1 .
i am having a problem with comparing two strings. I am taking
in the parameter rs("Company") and if this is empty i want to put some
text in there. I am testing it with an empty Company field and comparing
it like so:
temp1=rs("Company")
temp2=StrComp(temp1,NULL)
I have also tried it with
temp2=StrComp(temp1,"")
but each time i get nothing returned. Is there some rule about comparing a
string with an empty string?
I have an expiry date stored as a text field in the
following way "2003-08-23" (this gets round the US/UK
date prob)
The problem is I want to be able to show a Renew option
on the page FROM 30 days prior to that date. And then of
course if they don't renew, it unsubscribes them.
Question, how can I compare this date to see if todays
date is 30 days or closer to the expiry date?
I have this page with a drop down box which loads the itemnumbers dynamically. However, I want it to NOT load the numbers that already exist in the weborderlist. What can I do to my SQL statement to make this work?
Code:
SELECT (SELECT img_inv.item_num from img_inv, weborderlist WHERE img_inv.item_num <> weborderlist.item_num and weborderlist.orderid= '1') as test
how can i redirect a user when its 2 days before New Years, based on Date().
View Replies View RelatedHow do I compare the contents of two tables, to see what doesn't exist in the one table?
Something like "select company.name, company_scores.company_name from
company, company_scores where company.name not in
company_scores.company_name" ?
Need to do a search engine to search through a bunch of static pages (html)). so uing asp. but the page is in chinese, so how do i scan each and every html file and search for the chinese word?
View Replies View RelatedI have the following code with me Code:
<%
rs=Server.CreateObject("ADODB.recordset");
rs1=Server.CreateObject("ADODB.recordset");
sql="select coi_index_number,status,mkt_id_swno_0,mkt_id_swno_ 1,mkt_id_swno_2,mkt_id_swno_3,mkt_id_swno_4,mkt_id _swno_5,mkt_id_swno_6,mkt_id_swno_7,circle,name_of _msc from coi where coi_index_number='"+p2+"'";
sql1="select coi_index_number,status,mkt_id_swno_0,mkt_id_swno_ 1,mkt_id_swno_2,mkt_id_swno_3,mkt_id_swno_4,mkt_id _swno_5,mkt_id_swno_6,mkt_id_swno_7,circle,name_of _msc from coi1 where coi_index_number='"+p2+"'";
%>
Now i need to compare these two above mentioned recordsets....and want to pop up an alert box on the client side.....sayin whether they are same or no.
basically the first array holds all the text_ids for the table text and the second array holds all the text_ids on a table join. What i mean is i have joined two tables text and text_section and it lists all the textids in the section.
i need to return a list of the textids that are not listed in the section so i need a way of comparing the two arrays and pulling out the ids that appear in array1 and not array 2 .
I have ASP code to compare an input date and the current date. If the input date is less than today, it should give an error message. It does do this, except it doesn't consider the year, only the month and day. If I input 7/12/2004, it will not catch the discrepancy, but if I input 2/3/2005, it will. Here is the code...
SDate=FormatDateTime(Request.QueryString ("PickupDate"), 2)
FDate=FormatDateTime(Date(), 2)
If (SDate<=FDate) then
msg="You must enter a date greater than today."
Response.Write("<b><font color=red>"& msg & "</b></font><BR>")
Exit Sub
End If
Comparing dates ?!? I having fun with dates, NOT….. I have a place where I need to compare 2 dates. Even though they are the same they will not be compared as the same in an IF statement.
Donw is a # of the day of the month, IE: 26 that is pulled from a data base. The goal is to compare dats like this :
IF ( donw ) = day(now) then
----Red stament Do this Bla Bla----
Elseif (donw ) = day(now) – 1 then
----Yellow stament Do this Bla Bla----
Elseif (donw) < day(now) then
----Green stament Do this Bla Bla----
end if
Is there any way to compare a set of varibles to find the one that contains the biggest number? and also the one that contains the 2nd biggest.
View Replies View Related