Jump to content

Search the Community

Showing results for tags 'format'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH


  • Community Calendar




Website URL








Found 10 results

  1. Hi – I’m having a lot of trouble with a where clause with a date in my sql query. It seems I have tried everything and read many articles & blogs, but I can’t get it working. I understand the data type is very important to match up and the format also. Anyway I’ll tell you what I’ve got and see if anyone can help me. I’m joining 3 tables in my query – everything works fine and I get the results I want UNTIL I add the where clause. Unless there is something I need to change because of the where clause, I shouldn’t need advice on that. Tables Fields Kiosks – kioskID, workDate, locationID, workerID, bills, coins - workDate is type Date Locations - locationID, storeName, branchName, locationAbbrev Workers - workerID, firstName, lastName, phoneNum $sql = "SELECT Kiosks.kioskID, Kiosks.workDate, Locations.locationAbbrev, CONCAT(Workers.firstName, ' ', Workers.lastName) AS workerName, Kiosks.bills + Kiosks.coins AS amount FROM Locations INNER JOIN Kiosks ON Locations.locationID = Kiosks.locationID INNER JOIN Workers ON Kiosks.workerID = Workers.workerID”; This part works fine and I get a long list showing the Date, Location, Worker, and Amount using PHP. BUT,(everybody’s got a big BUTT) when I tack on the Where clause – kapoof!! When I try different formats I get either 0 results or unable to process messages. Here are a couple of things I’ve tried – hopefully someone can spot the error in my ways. Thanks $sql = "SELECT Kiosks.kioskID, Kiosks.workDate, Locations.locationAbbrev, CONCAT(Workers.firstName, ' ', Workers.lastName) AS workerName, Kiosks.bills + Kiosks.coins AS amount FROM Locations INNER JOIN Kiosks ON Locations.locationID = Kiosks.locationID INNER JOIN Workers ON Kiosks.workerID = Workers.workerID WHERE Kiosks.workDate = '2017-12-05'"; Also tried without quotes like = 2017-12-05 $sql = "SELECT Kiosks.kioskID, Kiosks.workDate, Locations.locationAbbrev, CONCAT(Workers.firstName, ' ', Workers.lastName) AS workerName, Kiosks.bills + Kiosks.coins AS amount FROM Locations INNER JOIN Kiosks ON Locations.locationID = Kiosks.locationID INNER JOIN Workers ON Kiosks.workerID = Workers.workerID WHERE year(Kiosks.workDate) = 2017 AND month(Kiosks.workDate) = 12 AND day(Kiosks.workDate) = 5";
  2. Hi, i'm reading back and forward but not really coming t a solution. I would like to grab the content of an input field (not inside a form) i am using for date, but just as string. the needed output format is always DD/MM/YYYY so said : 12.02.16 or 2016 12.2.16 or 2016 12-02-16 and so on should all result in 12/02/2016 if there would be a timestamp behind it just needs to be cutted off. I really thought this would be easier :-) But it isn't Maybe somebody could point out a good article or solution for me. Thx. I'm really struggling with the regular expressions :-) var txt='31-12/2016'; var re1='(\\d)'; // Any Single Digit 1 var re2='(\\d)'; // Any Single Digit 2 var re3='(.)'; // Any Single Character 3 var re4='(\\d)'; // Any Single Digit 1 var re5='(\\d)'; // Any Single Digit 2 var re6='(.)'; // Any Single Character 4 var re7='((??:[1]{1}\\d{1}\\d{1}\\d{1})|(?:[2]{1}\\d{3})))(?![\\d])'; // Year 1 var p = new RegExp(re1+re2+re3+re4+re5+re6+re7,["i"]); var m = p.exec(txt); if (m !== null) { var c1=m[1]; var c2=m[2]; var c3="/"; var d1=m[4]; var d2=m[5]; var c4="/"; var year1=m[7]; alert(c1+c2+c3+d1+d2+c4+year1+"\n"); } else { alert("Please check format"); }
  3. Hi all,I'm a student of the humanities and I'd never used xml till this morning. I'm trying to mark up some bibliographic information from an index card. Below is what I have so far. ?xml version="1.0" encoding="UTF-8"?><TEI xmlns="http://www.tei-c.org/ns/1.0"><teiHeader> <fileDesc> <titleStmt> <title>Prof. Ruth Sherry Archive of Frank O'Connor material</title> </titleStmt> <publicationStmt> <p>Published as an exercise for University College Cork MA module EN6009 Contemporary Literary Research</p> </publicationStmt> <sourceDesc> <p>Archive from University College Cork Boole Library Special Collections</p> </sourceDesc> </fileDesc> <revisionDesc> <list> <item> <date>29 January 2014</date>first edition</item> </list> </revisionDesc></teiHeader> <text> <body> <bibl><author><name><persName><surname>Ruthven</surname><forename>K.K.</forename></persName></name></author> <title>Feminist Literary Studies: An Introduction</title> <date>1984</date> <publisher>Cambridge University Press</publisher> <pubPlace>Cambridge</pubPlace> </bibl> <lg> <l> K.K. Ruthven 1105</l> <l> Feminist Literary Studies:</l> <l> An Introduction</l> <l> Cambridge: Cambridge Univ. Press 1984</l> </lg> </body></text> </TEI> I want to insert an element that contains the information that this is index card number 1105 (ideally I'd like to convey that it is index card 1105 of 3200). I asked my lecturer how to do this in class but her response was a little hurried as we were just finishing up and I didn't get to try inserting the information till after class. I was told to put it in under either <text> or <body>, whichever would take it. She told me I should put the information in an <xml:id=""> tag but this is not legal. I can amend my <text> or <body> tag to include an xml:id, like so <text xml:id="indexCard"> but this doesn't seem appropriate. I suppose the attribution implies that the text is an index card, which is valid information but it says nothing of the number - the value I wish to convey. I tried simply defining an element like <indexCard>1105</indexCard> within my <text> tag or <body> tag but this is not permissible either. How do I define such an element and attribute it a value? There are a few other details I'd like to address also. Within my <bibl> tag I have a forename tag. It is illegal to change this to <initials> but the information I have is not strictly a forename and for the life of me I cannot find what the initials K.K. stand for! Is there a legal tag I can use instead which would be more accurate? Lastly, just a couple of formatting questions. How do I preserve white space? In Oxygen, when I switch from text to Author view, the white space I include in my text is collapsed to a single space. I would like to preserve the layout of the text as best as possible. Similarly, I wish to skip lines in my text section. If I leave an empty line tag <l></l>, it appears as a single bold letter l rather than a blank line. Any suggestions would be greatly appreciated. Please forgive (but do point out) any misuse of terminology. **EDIT: Never mind about the <forename> issue. I found out that it's Ken K. and also that it is acceptable to put initials under this tag.**
  4. String.format()

    Hello guys, i need some basic info here. I need to build string, which must be builded into "'%name%'", when name is a variable. Using concat, its easy to do that:String myString = "'%" + name + "%'";how to do that with String.format() ?I`m trying to do like: String myString = String.format("'%%s%'", name); << it appears a problem with "%'" tag. how to avoid that ? How to use double %`s in the quotas ?Any suggestions ? Linas.
  5. Hello all, I have tried so many things to get this to work but to no avail, can someon eplease help me out here with a simple script for n XML steam feed. http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0002/?gameid=221380&format=xml OK NOW THE ISSUE IS: I have a blank webpage which I have placed the above link into, I simply want the contents of the XML feed from the link to appear in my page....... How do I make the contents of that url appear on the same page?? SO I NEED THE SMALL SCRIPT OR HTML CODE TO DO THIS Also I would like to have the background a certain colour and use a certain font like 12point arial with bold headings and lower case text. Can someone please provide me with the html to allow this XML feed to appear on my webpage with a different colour background, arial 12pt font in bold and lowercase Could someone pleasde please help me.......... With regards Mathew
  6. Pages and paragraphs in xml

    Hello,I'm currently having the following problem. I have xml data which needs formatting as pages and paragraphs, i.e.<Document><Page><Paragraph><Line>This is a paragraph</Line><Line>This is line 2</Line></Paragraph></Page></Document>This is all well and good, but does not allow for paragraphs which go over a page boundary.Any suggestions would be most welcome,
  7. HTML Formatting TAGs

    I just finished learning HTML and stated learning CSS. On the CSS Introduction Page they say "HTML was never intended to contain tags for formatting a document." Does this mean I can just forget all the formating TAGs( including the ones that are supported in HTML5 and aren't deprecated ) because CSS can handle it?
  8. emailing form data

    I am creating a form that is captured and placed in an email. I have managed to do this fine with the exception of one item. when getting the value of a text area it will not maintain the user entered format. Thsi will be important when recieving the information in the email. what I need is this, when a user enters the below info in a textarea;---example---Reference line 1Reference line 2Reference line 3Reference line 4----------------- I need it to popluate in the email the same way. When I pull this infor like a normal input it comes out like this; Reference line 1Reference line 2Reference line 3Reference line 4 can anyone help? I am not able to use PHP in my environment I am working with, as I understand it now. I also do not know much about asp.net
  9. I have attached my sample website. In it how do i arrange multiple "div" and why do some break up at different screen sizes. Check my code and help me find my mistakes. index.html
  10. I am working in xslt 1.0, and cannot use extensions & am limited as to what namespaces can be used (currently only http://www.w3.org/1999/XSL/Transform can be used). Another limitation I am working with is the 3rd party application I am using will not properly process includes or imports into the XSL. In other words - the xslt that I need to use must be pretty much self-inclusive, in that whatever is called or referenced must be in the xslt itself & nowhere else. I had decided to try to do a conversion to Julian date & mimic how Excel might do the conversion. I've got the date part figured out, but the hour part is what I'm having trouble with. The example I am using is:Start Time = 08:19:37End Time = 15:58:33 which is a duration/difference of 7:38:56 (BTW, this is only for same-day calculation - I have it to throw an error if Endtime < Start Time or if the Day is > 0). To arrive at the time, I convert everything to seconds & then do the math.08:19:37 converts to 29977 (8 * 3600 for hours + 19 * 60 for minutes + seconds).15:58:33 converts to 57513 (15 * 3600 for hours + 58 *60 for minutes + seconds). The difference is 27536 seconds. I get:27536/3600 =7.6488888888888888888 <-- the integer part is hoursthen the difference of 27536 - 25200 = 2336 <-- the 25200 = 7 hours * 3600 seconds2336/60 = 38.93333333333333333 <-- the integer part is 38 minutesthen the difference of 2336 - 2280 = 56 seconds from above. However, if I try to grab the integer portion of these numbers, its subject to rounding. <xsl:template name="time-difference"> <xsl:param name="from-hour"/> <xsl:param name="from-minute"/> <xsl:param name="from-second"/> <xsl:param name="to-hour"/> <xsl:param name="to-minute"/> <xsl:param name="to-second"/><xsl:variable name="f-secs" select="($from-hour * 3600) + ($from-minute * 60) + ($from-second)"/><xsl:variable name="t-secs" select="($to-hour * 3600) + ($to-minute * 60) + ($to-second)"/><xsl:variable name="sec-diff" select="$t-secs - $f-secs"/><xsl:variable name="daysec-diff" select="format-number(($sec-diff div 86400),'#')"/><xsl:variable name="q" select="($sec-diff div 3600)"/><xsl:variable name="t-hrs-diff" select="format-number(($sec-diff div 3600),'00')"/>.......</xsl:template> The variable q above has 7.648888888888888888 (which is correct)however, the t-hrs-diff once the format-number happens now has "08" in it, making my time incorrect. I know any other formatting attempt to grab the integer portion of the number would result in rounding. Outside of the substring-before & substring-after - which would (I think) make me have to convert the result to a number before using in the next calculation - is there ANY other way to grab the unaltered integer portion of the number & not have to do conversion from a string to number to use the pieces? Is there a better way to do this, given the limitations I have? I would appreciate any thoughts or suggestions. Thanks!