SQL

Got a SQL question? Any SQL flavor here, just ask. Indicate yo...
Dec 11, 2018 07:43
How can I use the order by in this query using the left join to create a view?
Dec 11, 2018 07:43
select v5.UtilityType,
v5.AccountNumber,
v5.AccountNumberID,
v5.MeterNumberID,
v5.MonthlyTotal as CRBilledAmount,
v5.ServiceFromDate as CRServiceFromDate,
-- v5.ServiceFromMonth as CRServiceFromMonth,
-- v5.ServiceFromYear as CRServiceFromYear,
-- v5.ServiceToDate as CRServiceToDate,
-- v5.ServiceToMonth as CRServiceToMonth,
-- v5.ServiceToYear as CRServiceToYear,
v5.TotalDays as CRDaysInCycle,
v5.DailyRate as CRDailyRate,
v6.MonthlyTotal as PYBilledAmount,
v6.ServiceFromDate as PYServiceFromDate,
Dec 7, 2018 21:20
?
Dec 7, 2018 21:20
How can I combine columns when v5.MeterNumberID = v6.MeterNumberID has variable or is null.
Dec 7, 2018 21:20
from cte v5
left join
cte v6
on v5.UtilityType = v6.UtilityType and v5.AccountNumberID = v6.AccountNumberID and
v5.MeterNumberID = v6.MeterNumberID
Dec 6, 2018 21:36
by*
Dec 6, 2018 21:35
When I test this calculation it's off my a couple of digits.
Dec 6, 2018 21:35
CASE
WHEN ServiceFromDate = ServiceToDate THEN BilledAmount
ELSE BilledAmount/DATEDIFF(DAY, ServiceFromDate, ServiceToDate)
END AS MyDailyRate
Nov 30, 2018 14:20
Or when myDaysInCylce is less than 0.
Nov 30, 2018 14:19
ServiceFromDate serviceToDate
06/01/18 0201-06-30
07/01/18 0208-07-31
11/29/27 12/27/17
10/01/18 0201-10-30
05/22/18 0208-06-22
12/05/17 01/05/17
11/05/17 0217-12-05
Nov 30, 2018 14:15
I'm creating a view based off of another view. I'm trying to get ServiceToDate < ServiceFromDate these out, but I'm not sure how to go about it.
Nov 30, 2018 14:14
SELECT distinct UtilityType,
MeterNumberID,
AccountNumberID,
AccountNumber,
billedAmount,
ServiceFromDate,
serviceToDate,
DATEPART(YEAR,ServiceFromDate) AS ServiceFromYear,
DATEPART(MONTH,ServiceFromDate) AS ServiceFromMonth,
DATEPART(YEAR,ServiceToDate) AS ServiceToYear,
DATEPART(MONTH,ServiceToDate) AS ServiceToMonth,
DATEDIFF(DAY,ServiceFromDate,ServiceToDate) AS myDaysInCycle,
CASE
WHEN ServiceFromDate = serviceToDate THEN 1
ELSE BilledAmount/DATEDIFF(DAY, ServiceFromDate, servicetodate)
END AS myDailyRate
Nov 29, 2018 19:57
I want to have the ability to select all the rows where ServiceToDate is an older date than ServiceFromDate.
Nov 29, 2018 19:57
ServiceFromDat serviceToDate
2017-10-16 2017-11-15
2017-10-16 2017-09-19
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Nov 29, 2018 20:15
@Tiffany
Nov 29, 2018 20:15
I've seen some people use dateDiff but it's not working for me. @tiff
Nov 29, 2018 19:58
ServiceFromDat serviceToDate
2017-10-16 2017-11-15
2017-10-16 2017-09-19
I want to have the ability to select all the rows where ServiceToDate is an older date than ServiceFromDate in SQL.
 

C#

General discussions about the c# language, Squirrels | gist.gi...
Nov 21, 2018 05:49
This is a working program.
Nov 21, 2018 05:48
If anyone is interested on how to get columns from excel and go through each column to create a SQL update.
Nov 21, 2018 05:47
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Excel;

namespace UpdateFID
{
public class Program
{
static void Main(string[] args)
{
Application excelApp = new Application();

if (excelApp == null)
{
Console.WriteLine("Excel is not installed");
return;
}
string strPath = Environment.GetFolderPath(System.Environment.SpecialFolder.DesktopDirectory);

if (File.Exists(strPath + @"\updateFID.sql"))
Nov 21, 2018 03:54
Once I get that information from the excel I want to access my list or table and get those value and write a SQL update script. Update tableName set FID = '" + x.FID + "where LocationId = '" + x.LocationId)....
Nov 21, 2018 03:51
I'm trying to read an excel sheet that has two columns and store that in a table or list.
Nov 21, 2018 03:45
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Excel;

namespace UpdateFID
{
public class Program
{
static void Main(string[] args)
{
Application excelApp = new Application();

if (excelApp == null)
{
Console.WriteLine("Excel is not installed");
return;
}

Workbook excelBook = excelApp.Workbooks.Open(@"C:\Test\Book1.xlsx");
_Worksheet excelSheet = excelBook.Sheets[1];
Range excelRange = excelSheet.UsedRange;
Nov 21, 2018 03:45
I'm getting an error on the ForEach.
Nov 21, 2018 03:41
In other words I will only need to go through the for loop once.
Nov 21, 2018 03:40
public class Location
{
public string LocationId;
public string FID;
}
Nov 21, 2018 03:16
LocationID FID
10 100
20 200
30 300
40 400
Nov 21, 2018 03:15
LocationID FID
10 100
20 200
30 300
40 400
Nov 21, 2018 03:14
I'm trying to store my data from excel to a list.
Nov 21, 2018 03:14
  List<Location> myInfo = new List<Location>();

            int rows = excelRange.Rows.Count;
            int cols = excelRange.Columns.Count;

            for (int i = 1; i <= rows; i++)
            {

                for (int j = 1; j <= cols; j++)
                {
                    Location myList = new Location();
                    if(excelRange.Cells[i] != null)
                    {
                        myList.LocationId = excelRange.Cells[i].Value1.ToString();
                        myInfo.Add(myList);
 

JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Aug 23, 2018 15:31
I have a regular expression that I only want the string format to have the following format: CN123456 or cn123456. No more than 8 characters and only take CN in the beginning followed by 6 numbers. I'm not sure what else I'm missing.
var regexPat = /^[CN]{2}\d{6}+$/;
Oct 23, 2017 17:54
beginner :/
Oct 23, 2017 17:52
That is the code that the developer used.@Vapor
Oct 23, 2017 17:50
The final product.
Oct 23, 2017 17:50
Later on.
Oct 23, 2017 17:50
In the UI they want it to display 1,254.98.
Oct 23, 2017 17:49
1000.00
Oct 23, 2017 17:49
Commas and decimals.
Oct 23, 2017 17:48
I type that in and when I tab over I get 1025
Oct 23, 2017 17:48
1,025.25
Oct 23, 2017 17:48
1,000
Oct 23, 2017 17:48
Yes.
Oct 23, 2017 17:47
That will accept commas, numbers only, with 2 fixed decimal places.
Oct 23, 2017 17:47
34.34 I just need a currency number.
Oct 23, 2017 17:45
I have this code above. I am able to type in 34.34 but when I tab over to the next text box it cuts off the decimal number.
Oct 20, 2017 14:22
                            function calculate() {
                                var sum = 0;
                                $(".txt").each(function () {
                                    if (!isNaN(this.value) && this.value.length != 0) {
                                        sum += parseFloat(this.value);
                                    }
                                    console.log(".txt");
                                });

                                document.getElementById("<%=txtFBTotal.ClientID %>").value = sum.toFixed(2);
Sep 28, 2017 14:38
<label style="padding-left: 227px"><input type="checkbox" value="" id="ckPhysicalAddressReturned" data-toggle="toggle">Address Returned</label>
Sep 28, 2017 14:37
I am trying to enable a check box when the textbox has data and uncheck the checkbox when there is not data in the textbox.                                                                                                $(document).ready(function () {
        $("#ContentPlaceHolder1_MainContent_txtPhysicalAddressLine1").keyup(function() {
            if ($(this).val() == '') {
                $(".ContentPlaceHolder1_MainContent_ckPhysicalAddressReturned").prop('checked', false);
            }
            else {
 

Trash can

Like the recycle bin, but trashier.
Oct 23, 2017 17:44
 function addCommas(clientID) {

                                var nStr = document.getElementById(clientID.id).value;

                                nStr += '';
                                x = nStr.split('.');
                                //if (!x[0]) {
                                //    x[0] = "0";

                                //}
                                x1 = x[0];
                                if (!x[1]) {
                                    x[1] = "00";
                                }
Oct 20, 2017 14:21
I have ten aspn textbox. I'm using this method to calculate the addition but when I try to calculate 1000 ten times I get a 1,000. If I put in 1 I get 11. What am I doing wrong. function calculate() {
var sum = 0;
$(".txt").each(function () {
if (!isNaN(this.value) && this.value.length != 0) {
sum += parseFloat(this.value);
}
console.log(".txt");
});

document.getElementById("<%=txtFBTotal.ClientID %>").value = sum.toFixed(2);
console.log("#txtFBTotal")
}