Jump to content

Charlatat

Members
  • Posts

    27
  • Joined

  • Last visited

Posts posted by Charlatat

  1. Trying to update a field that has the bit datatype. From various documentation, I've tried using the value 1 for this. However, its showing up as -1 when I view the database. Using this statement:INSERT INTO DB.dbo.table ([Contact]) VALUES (1)Am I missing something, or is this expected behavior? Thanks

  2. You can try _ "underscore" wildcard. this looks for only one character..... .......... WHERE (field LIKE '%PHDOL1106___Wk10%') [contains 3 underscore, one for each character]
    Thanks, that was EXACTLY what I needed!
  3. search string = 'PHDOL1106ABCWk10'I can presently do a select statement WHERE (field LIKE '%PHDOL1106%') which works fine, but there's a lot of results to process.I would like it to return fewer results, so is there a way of doing a search similiar to this: WHERE (field LIKE '%PHDOL1106???Wk10%') ? The ABC in the above search string varies and so would need the query to process any letter in the ? part. Is this doable? If this doesn't make sense, let me know and I'll try to explain it better. Thanks

  4. SELECT contact1.contact,contact1.address1,contact1.address2,contact1.city,contact1.state,contact1.zip,conthist.ondate,contact1.key3,conthist.resultcode,conthist.accountno,conthist.userid,conthist.recidFROM contact1 INNER JOIN conthist ON contact1.accountno = conthist.accountno INNER JOIN Cal ON contact1.accountno = Cal.accountnoWHERE (conthist.RESULTCODE = 'TNS') AND (contact1.address1 <> '' OR contact1.city <> '' OR contact1.state <> '' OR contact1.zip <> '') AND (contact1.accountno NOT IN (SELECT conthist.accountno FROM conthist WHERE (conthist.resultcode IN ('SLE','SLD','SL1','SL2'))))

    I get a "Table doesn't exist" error, which is the same as when I tried just "FROM contact1,conthist,cal". I know each table does, in fact, exist. Also, these are dbf files. Just in case that makes a difference

  5. Well, it'll fail when I do this:

    SELECT contact1.contact,contact1.address1,contact1.address2,contact1.city,contact1.state,contact1.zip,conthist.ondate,contact1.key3,conthist.resultcode,conthist.accountno,conthist.userid,conthist.recid FROM contact1,conthist,calWHERE (contact1.accountno = conthist.accountno AND contact1.accountno = cal.accountno)

    it will pretty much fail when the FROM statement has more than 2 tables in it. Thought there was a standard way of joining/querying 3+ tables within a single statement, thus the plea for help.

  6. I have a complicated query, that I need to make more complicated. The current query is this:

    SELECT contact1.contact,contact1.address1,contact1.address2,contact1.city,contact1.state,contact1.zip,conthist.ondate,contact1.key3,conthist.resultcode,conthist.accountno,conthist.userid,conthist.recid FROM conthist INNER JOIN contact1 ON conthist.accountno = contact1.accountno WHERE (conthist.RESULTCODE = 'TNS') AND (contact1.address1 <> '' OR contact1.city <> '' OR contact1.state <> '' OR contact1.zip <> '') AND (ondate = '%targetdate%') AND (contact1.accountno NOT IN (SELECT conthist.accountno FROM conthist WHERE (conthist.resultcode IN ('SLE','SLD','SL1','SL2') AND (conthist.ondate BETWEEN '%targetdate%' AND '%now%'))))"

    %targetdate% = '1/1/2007'%now% = automatically generatedNeed to incorporate a third table into this mix (CAL), where cal.rectype = 'A' AND cal.ondate > '%now%'Everytime I try adding the third table, I get fatal errors (even when I don't query it at all). Was wondering if someone could offer a suggestion? Thanks

  7. umm, yeah....the < and > buttons scroll thru the choices from the csv file. It contains 2 fields, the office name, and a mapquest web link directing to the office's address. So, when a user clicks on the button that shows the office they want, it directs the page to the corresponding siteI need the info that you all helped me put into the fields to be automatically placed within the web link. Here's one of the links as an example:http://www.mapquest.com/directions/main.ad...z=55303&r=fDoes this make sense?

  8. whoohoo! that works! even hosted locally, without a webserver it works... hehNOW, next 2 questions...now that the information is present in the fields, when a user clicks the button, it opens a new window.1. what's the command to direct the current page to the new URL instead of opening a new window?2. how do I pass the values from the fields to within the custom weblink (which is pulled from the csv file)?sorry about all the questions, I AM new and learning as we go

  9. still nada.buttons.html:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><script type="text/javascript" src="request.js"</HEAD><TITLE>MapQuest Directions from GoldMine</TITLE><script type="text/javascript">  onload= function()  {	document.getElementById('address').value = Request.QueryString["address"];	document.getElementById('city').value = Request.QueryString["city"];	document.getElementById('state').value = Request.QueryString["state"];	document.getElementById('zip').value = Request.QueryString["zip"];  }</script><script FOR=tdcLinks EVENT=ondatasetchanged>   // Once the recordset is available, set the web page URL to the last record in the data set   WEBLINK=tdcLinks.recordset.fields('Weblink');</SCRIPT><script FOR=btnLink EVENT=onclick>   window.open(WEBLINK);</SCRIPT><div style="display:none"><OBJECT classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"	ID=tdcLinks HEIGHT=0 WIDTH=0>	<PARAM NAME="DataURL" VALUE="OfficeLoc.csv">	<PARAM NAME="UseHeader" VALUE="True"></OBJECT></div><H2> Contact's Address Information:</H2> <FORM action="http://www.mapquest.com" method="post">	<P>	<LABEL for="address">Address: </LABEL>			  <INPUT type="text" id="address"><BR>	<LABEL for="city">City: </LABEL>			  <INPUT type="text" id="city"><BR>	<LABEL for="state">State: </LABEL>			  <INPUT type="text" id="state"><BR>	<LABEL for="zip">Zip Code: </LABEL>			  <INPUT type="text" id="zip"><BR>	</P> </FORM><br><H2>Select an Office:</H2>Click this button to get directions to: <TAB><BUTTON ID="btnLink" DATASRC="#tdcLinks" DATAFLD="Office"></BUTTON><BR><BR><INPUT ID=cmdNavFirst TYPE=BUTTON VALUE="<<" 	onclick="tdcLinks.recordset.MoveFirst()"><INPUT ID=cmdNavPrev TYPE=BUTTON VALUE="<" STYLE="width:20px"	onclick="tdcLinks.recordset.MovePrevious(); if (tdcLinks.recordset.BOF)tdcLinks.recordset.MoveFirst();"><INPUT ID=cmdNavNext TYPE=BUTTON VALUE=">" STYLE="width:20px" 	onclick="tdcLinks.recordset.MoveNext(); if(tdcLinks.recordset.EOF)tdcLinks.recordset.MoveLast();"><INPUT ID=cmdNavLast TYPE=BUTTON VALUE=">>" 	onclick="tdcLinks.recordset.MoveLast()"></BODY></HTML>

    request.js:

    //Request Object	var Request = 	{		QueryString: [],//return value of given variable	}	//load Request.QueryString	var q = window.location.href.split('?')[1];	var pairs = (q != null) ? q.split('&') : [];	for(var i=0;i<pairs.length;i++)	{		var pair = pairs[i].split('=');		Request.QueryString[pair[0]] = (pair == null) ? pair[1] : "";	}

  10. With the third "/", I didn't get any errors this time, thanks. However, its not filling in the fields like I expected it to. Here's the code for the html:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>MapQuest Directions from GoldMine</TITLE><script FOR=tdcLinks EVENT=ondatasetchanged>   // Once the recordset is available, set the web page URL to the last record in the data set   WEBLINK=tdcLinks.recordset.fields('Weblink');</SCRIPT><script FOR=btnLink EVENT=onclick>   window.open(WEBLINK);</SCRIPT><div style="display:none"><OBJECT classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83"	ID=tdcLinks HEIGHT=0 WIDTH=0>	<PARAM NAME="DataURL" VALUE="OfficeLoc.csv">	<PARAM NAME="UseHeader" VALUE="True"></OBJECT></div><H2> Contact's Address Information:</H2> <FORM action="http://www.mapquest.com" method="post">	<P>	<LABEL for="address">Address: </LABEL>			  <INPUT type="text" id="address"><BR>	<LABEL for="city">City: </LABEL>			  <INPUT type="text" id="city"><BR>	<LABEL for="state">State: </LABEL>			  <INPUT type="text" id="state"><BR>	<LABEL for="zip">Zip Code: </LABEL>			  <INPUT type="text" id="zip"><BR>	</P> </FORM><br><H2>Select an Office:</H2>Click this button to get directions to: <TAB><BUTTON ID="btnLink" DATASRC="#tdcLinks" DATAFLD="Office"></BUTTON><BR><BR><INPUT ID=cmdNavFirst TYPE=BUTTON VALUE="<<" 	onclick="tdcLinks.recordset.MoveFirst()"><INPUT ID=cmdNavPrev TYPE=BUTTON VALUE="<" STYLE="width:20px"	onclick="tdcLinks.recordset.MovePrevious(); if (tdcLinks.recordset.BOF)tdcLinks.recordset.MoveFirst();"><INPUT ID=cmdNavNext TYPE=BUTTON VALUE=">" STYLE="width:20px" 	onclick="tdcLinks.recordset.MoveNext(); if(tdcLinks.recordset.EOF)tdcLinks.recordset.MoveLast();"><INPUT ID=cmdNavLast TYPE=BUTTON VALUE=">>" 	onclick="tdcLinks.recordset.MoveLast()"></BODY></HTML>

  11. Was wondering what the URL syntax would look like... I have a page/form that has a few text fields, and want to be able to click on a link that calls up the page and autofills the text fields. Should be pretty easy, just that I'm at a loss. Thanks

  12. Ok, I'll try to struggle with it, since I'm only passingly familiar with HTML. I'm trying to eliminate the buttons and any SCRIPT out of it entirely. So that when they select an item from the dropdown list, it goes immediately to the weblink location. Is that possible?

  13. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><TITLE>MapQuest Directions from GoldMine</TITLE></HEAD><script FOR=tdcLinks EVENT=ondatasetchanged> // Once the recordset is available, set the web page URL to the last record in the data set WEBLINK=tdcLinks.recordset.fields('Weblink');</SCRIPT><script FOR=btnLink EVENT=onclick> window.open(WEBLINK);</SCRIPT><div style="display:none"><OBJECT classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" ID=tdcLinks HEIGHT=0 WIDTH=0> <PARAM NAME="DataURL" VALUE="OfficeLoc.csv"> <PARAM NAME="UseHeader" VALUE="True"></OBJECT></div><H2>Select an Office:</H2><INPUT ID=cmdNavFirst TYPE=BUTTON VALUE="<<" onclick="tdcLinks.recordset.MoveFirst()"><INPUT ID=cmdNavPrev TYPE=BUTTON VALUE="<" STYLE="width:20px" onclick="tdcLinks.recordset.MovePrevious(); if (tdcLinks.recordset.BOF)tdcLinks.recordset.MoveFirst();"><INPUT ID=cmdNavNext TYPE=BUTTON VALUE=">" STYLE="width:20px" onclick="tdcLinks.recordset.MoveNext(); if(tdcLinks.recordset.EOF)tdcLinks.recordset.MoveLast();"><INPUT ID=cmdNavLast TYPE=BUTTON VALUE=">>" onclick="tdcLinks.recordset.MoveLast()"><BR><BR><BR>Click this button to get directions to <TAB><BUTTON ID="btnLink" DATASRC="#tdcLinks" DATAFLD="Office"></BUTTON></HTML>

  14. Well, yes and no.Those are the options I want presented in the dropdown list, yes. But, these entries and more are located in an external CSV file. I've been successful in pulling data from this file, when using buttons to navigate the rows. However, I need this info to be available in a dynamic dropdown list.

  15. I don't have a code snippet handy, but open the file, read the data one line at a time and insert the data for the drop-down into an array. Use the array to populate the drop-down by looping through and adding the option tags. When I get my laptop back, later in the week, I have a snippet which does exactly that and I will post it up. (if I remember) In the meantime, perhaps someone else has a snippet???
    Anyone?
  16. targetdate and now are defined elsewhere in my script (dBase backend). Original statement (works fine):SELECT contact1.contact,contact1.address1,contact1.address2,contact1.city,contact1.state,contact1.zip,conthist.ondate,contact1.key3,conthist.resultcode,conthist.accountno FROM conthist INNER JOIN contact1 ON conthist.accountno = contact1.accountno WHERE (conthist.RESULTCODE = 'TNS' AND (conthist.resultcode NOT IN ('SLE','SLD','SL1','SL2'))) AND (conthist.ondate = #%targetdate%#) AND (contact1.address1 <> '' OR contact1.city <> '' OR contact1.state <> '' OR contact1.zip <> '')Want to modify the (conthist.RESULTCODE = 'TNS' AND (conthist.resultcode NOT IN ('SLE','SLD','SL1','SL2'))) section so that only a certain date range is looked at. Was thinking the new statement should be something like this (doesn't work):SELECT contact1.contact,contact1.address1,contact1.address2,contact1.city,contact1.state,contact1.zip,conthist.ondate,contact1.key3,conthist.resultcode,conthist.accountno FROM conthist INNER JOIN contact1 ON conthist.accountno = contact1.accountno WHERE (conthist.RESULTCODE = 'TNS' AND (conthist.resultcode NOT IN ('SLE','SLD','SL1','SL2') BETWEEN #%targetdate%# AND #%now%#)) AND (conthist.ondate = #%targetdate%#) AND (contact1.address1 <> '' OR contact1.city <> '' OR contact1.state <> '' OR contact1.zip <> '')Any suggestions? Thanks

  17. Ok, I think I worded my problem wrong. I don't need to delete records. I need to skip over records that meet the criteria I stated before AND not have a resultcode of "SLE,SLD,SL1,SL2" between now and the provided date. That way, I only get the records who have a resultcode of "TNS" on a certain date, and NOT the ones who have the other resultcode since the provided date.

×
×
  • Create New...