Results 1 to 3 of 3

Thread: sql with dates

  1. #1
    Guest

    Post

    hi! u see in acces a i have a database! and i hacve to retrieve dates. i am working with odbc databse and its called conexionBaseDonnees. i know its with the command LEN but im not shore can u help me? plz?

    Mryy x-mas!

    ------------------
    Mohamed

  2. #2
    Lively Member
    Join Date
    Jun 2018
    Posts
    125

    Re: sql with dates

    Quote Originally Posted by Pradeep1210 View Post
    I tried the regex on the links, numbers and email address you sent and all of them get selected.

    Is there any specific problem you are facing?
    Quote Originally Posted by Pradeep1210 View Post
    I tried the regex on the links, numbers and email address you sent and all of them get selected.

    Is there any specific problem you are facing?
    hi
    Maybe there is a problem in my whole code.
    This is my whole code
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="description" content=" RedAppleChat is a FREE chatting webApp.">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3pro.css">
    <title>RedAppleChat</title>
    <style>
        .bannerDiv {
        width: 100%;
        height: 50px;
        background-color: lime;
        text-align: center;
        
        }
        .UsernameLabelDiv{
                color: red;
                margin: auto;
                width:300px;
    			height:30px;
        }
        
        .myInputtextDiv{
                box-shadow: 10px 10px 8px #888888;
                margin: auto;
                border: 3px solid red;
                padding: 5px;
                width:300px;
    			height:90px;
                background-color:lightgrey ;
    
        }
        input[id=myUserName] {
        color: red;
        border:2px solid blue;
        border-radius: 4px;
        
    }
         input[id=myInput] {
        width: 100%;
        padding: 10px 10px;
         border: 2px solid red;
        border-radius: 4px;
        
    }
        
        .conDiv {
            color: blue;
            background-color: #ddd;
            border-color:red;
            overflow: auto;
            text-align: left;
            box-shadow: 10px 10px 8px #888888;
            margin: auto;
            border: 3px solid red;
            padding: 5px;
            width: 300px;
            height: 300px;
            word-wrap: break-word ;
        }
        .timeSpan{
            color: grey;
            font-size:10px;
           
        }
        .img{
       box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
       border: 1px solid lime;
        border-radius: 4px;
        padding: 5px;
         }
        .img:hover{
         width: 100%;
     height: auto;
       box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
         }
    </style>
    <script 
    src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">
    </script>
    </head>
    <link rel=" shortcut icon"  href="https://imgur.com/57AweD4.png" />
    <body>
    <div class=" bannerDiv">
       <img style=" width =40px;" height=" 40px" 
        src="https://imgur.com/57AweD4.png" alt="LOGO" />
       <span style="font-family: Times New Roman ;font-size: 30px; color: red"> 
       RedAppleChat</span>
    </div>
    
     <form>
      <div class=" UsernameLabelDiv">
     <input style="width: 300px" type="text"  placeholder="Username" id="myUserName"maxlength="10"onkeyup="saveValue(this)" onkeypress="return AvoidSpace(event)">
    </div>
    <div class="conDiv"  id="conDivID"></div>
             
              <div class=" myInputtextDiv">
                <input style="color:black;" type="text" id="myInput" maxlength="10000">
                <input type="text" id="baseimage" onkeyup=" sendImage()"  hidden  >
                </br>
    
    <input id="myBtn" type="button" onclick="sendFunction();" value=" Send">
                  
            <input id="fileInput" type="file" style="display: none;" />
            <input type="button" value="Choose Image!"onclick="document.getElementById                ('fileInput').click();" />
    <input id="myBtn" type="button" onclick="clearChat()" value=" Clear">
            </div>
                 <div class=" chooseBottun">
            </div>
               <br>
    
       <script>
           function sendFunction() {
               var d = new Date()
               var h12 = d.getHours();
               var h24 = d.getHours();
               var m = d.getMinutes();
               var s = d.getSeconds();
               if (s < 10) {
                   s = "0" + s
               }
               if (m < 10) {
                   m = "0" + m
               }
               if (h12 > 12) {
                   h12 = h12 - 12
               }
               if (h12 == 00) {
                       h12  = 12
                   }
    
               var timeStamp = h12 + ":" + m + ":" + s + " ";
               if (h24 > 11) {
                   timeStamp += "PM";
               } else {
                   timeStamp += "AM";
               }
    
               var userName = document.getElementById("myUserName").value;
               var userinput = document.getElementById("myInput").value;
               var imagesrc = document.getElementById("baseimage");
               var img = $('<img class="img" width=" =100px;" height=" 100px">')
                           .attr('src', imagesrc.value);
               var regex = new RegExp("^[A-Za-z0-9]+$");
               if (regex.test(userName)& imagesrc.value =="") {
    $('#conDivID').append("<span style='color: red'>" + userName + ': </span>');
    $('#conDivID').append( embedUrls(userinput));
    $('#conDivID').append('</br>');
    $('#conDivID').append("<span class='timeSpan'>" + timeStamp + '</span>');
    $('#conDivID').append('</br>');
    
                   document.getElementById('baseimage').value = "";
                   document.getElementById('myInput').value = "";
                   document.getElementById("myInput").focus();
                   
               } else if (regex.test(userName)& imagesrc.value !="") {
    $('#conDivID').append("<span style='color: red'>" + userName + ': </span>');
    $('#conDivID').append( embedUrls(userinput));
    $('#conDivID').append('</br>');
    $('#conDivID').append(img);
    $('#conDivID').append('</br>');
    $('#conDivID').append("<span class='timeSpan'>" + timeStamp + '</span>');
    $('#conDivID').append('</br>');
                   
                   document.getElementById('baseimage').value = "";
                   document.getElementById('myInput').value = "";
                   document.getElementById("myInput").focus();
                   }else {
    
                   alert("Please Enter Your Username To Start Chat,Only English Letters And Numbers Allowed Without Spaces Between Them In The Username Field.");
                   document.getElementById("myUserName").value = "";
                   document.getElementById("myUserName").focus();
    
               }
               //To use scrolls on the conDivID.
               document.getElementById("conDivID").scrollTop =
               document.getElementById("conDivID").scrollHeight;
           }
    </script> 
        </form>
        <br>
        <script >
            //To make links in div"conDiv" clickable
            function embedUrls(text) {
            var urlRe = /(https?:\/\/[^\s]+)|(?![\s^])[^\s]+?\.(?:com|net|org|om|us|uk|sa|gov)\b|[+\d][\d\s]+?/g;
            return text.replace(urlRe, '<a href="$1" target="_blank">$1</a>');
        }
    
        </script>
    <script>
    // To display image after browsing for it
        document.getElementById("fileInput").onchange = function () {
            var reader = new FileReader();
            reader.onload = function (e) {
                $('#fileInput').attr('src', e.target.result);
                $('#baseimage').val(e.target.result);
                sendFunction();
            };
            reader.readAsDataURL(this.files[0]);
            
        }
     </script>
     <script type="text/javascript"> 
     //To save myUserName text even after refreshing the page.
            document.getElementById("myUserName").value = getSavedValue("myUserName");   
            function saveValue(e){
                var id = e.id;
                var val = e.value; 
                localStorage.setItem(id, val);
            }  
            function getSavedValue  (v){
                if (localStorage.getItem(v) === null) {
                    return ""; 
                }
                return localStorage.getItem(v);
            }
    </script>
       
    <script> // To use Enter to send
                var input = document.getElementById("myInput");
                input.addEventListener("keyup", function (event) {
                    event.preventDefault();
                    if (event.keyCode === 13) {
                        document.getElementById("myBtn").click();
                    }
                });
                
    </script> 
     <script> 
    //To remove spaces from the beginning , the 
    //ending and between letters and words inside 
    //myUserName input text.
         
           function AvoidSpace(event) {
           var k = event ? event.which : window.event.keyCode;
           if (k == 32) return false; }
     </script>
       <script>//To clear chat.
         function clearChat(){
             document.getElementById('conDivID').innerHTML = "";
         }
     </script> 
    
    <div style="text-align:center;">
        <p>Select language to translate chat to</p>
      <div id="google_translate_element"></div>
    <script type="text/javascript"> //To add goole translation service.
    function googleTranslateElementInit() {
      new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
    }
    </script>
    
    <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
    
    </script>
    </div>
    </body>
    </html>

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: sql with dates

    Did the site just do something weird or did you just resurrect a thread that is 19 years old to make a completely unrelated post?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width